Skip to content

Commit 3f0fa2c

Browse files
rootkeamasatake
authored andcommitted
main: Allocate the exact amount of memory we need
(Cherry picked from #3155.)
1 parent d8fa0d6 commit 3f0fa2c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main/args.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ static char* nextFileLine (FILE* const fp)
145145
c = ungetc (c, fp);
146146
}
147147
vStringStripTrailing (vs);
148-
result = xMalloc (vStringLength (vs) + 1, char);
149148
vStringStripLeading (vs);
149+
result = xMalloc (vStringLength (vs) + 1, char);
150150
strcpy (result, vStringValue (vs));
151151
}
152152
vStringDelete (vs);

0 commit comments

Comments
 (0)