Skip to content

Commit 597f069

Browse files
Russell StewartRussell Stewart
authored andcommitted
Merge pull request #9 from Russell91/master
Fixed double free or corruption bug.
2 parents 97d2f31 + 4efe7b5 commit 597f069

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/glove.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ int save_params() {
135135
long long a, b;
136136
char format[20];
137137
char output_file[MAX_STRING_LENGTH], output_file_gsq[MAX_STRING_LENGTH];
138-
char *word = malloc(sizeof(char) * MAX_STRING_LENGTH);
138+
char *word = malloc(sizeof(char) * MAX_STRING_LENGTH + 1);
139139
FILE *fid, *fout, *fgs;
140140

141141
if(use_binary > 0) { // Save parameters in binary file

0 commit comments

Comments
 (0)