fix(object): free placement on actions parse
This commit is contained in:
parent
cba5d43039
commit
0b7d959663
1 changed files with 3 additions and 4 deletions
|
|
@ -288,13 +288,12 @@ int read_diff(char* content, char* basefile_hash, ActionList* diff_out) {
|
||||||
char* end;
|
char* end;
|
||||||
long actions = strtol(number_of_actions, &end, 10);
|
long actions = strtol(number_of_actions, &end, 10);
|
||||||
|
|
||||||
if (end == number_of_actions || *end != '\0' || actions <= 0) {
|
if (end == number_of_actions || *end != '\0' || actions < 0) {
|
||||||
perror("ERROR: invalid number of actions in read_diff!");
|
perror("ERROR: invalid number of actions in read_diff!");
|
||||||
|
free(number_of_actions);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(number_of_actions);
|
|
||||||
|
|
||||||
size_t action_idx = 0;
|
size_t action_idx = 0;
|
||||||
while (content[idx] && action_idx < (size_t)actions) {
|
while (content[idx] && action_idx < (size_t)actions) {
|
||||||
idx++;
|
idx++;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue