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
|
|
@ -287,14 +287,13 @@ int read_diff(char* content, char* basefile_hash, ActionList* diff_out) {
|
|||
|
||||
char* end;
|
||||
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!");
|
||||
free(number_of_actions);
|
||||
return 0;
|
||||
}
|
||||
|
||||
free(number_of_actions);
|
||||
|
||||
size_t action_idx = 0;
|
||||
while (content[idx] && action_idx < (size_t)actions) {
|
||||
idx++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue