Browse Source

fix #95 : Double free - Incorrect memory allocation in stringpair_list_append()

doc_update_sequoia
Edouard Tisserant 6 years ago
parent
commit
5c231017d5
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      src/stringpair.c

+ 7
- 2
src/stringpair.c View File

@ -123,9 +123,14 @@ DYNAMIC_API stringpair_list_t *stringpair_list_append(
stringpair_list_t *_s = stringpair_list;
stringpair_list_t *_s2;
for (_s2 = second; _s2 != NULL; _s2 = _s2->next) {
_s = stringpair_list_add(_s, _s2->value);
if (_s == NULL)
stringpair_t *_sp = stringpair_dup(_s2->value);
if (_sp == NULL)
return NULL;
_s = stringpair_list_add(_s, _sp);
if (_s == NULL){
free_stringpair(_sp);
return NULL;
}
}
return _s;
}


Loading…
Cancel
Save