Skip to content
Myr

jv_unique: don't leak non-unique elements that are not returned (#3304)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Emanuele Torre · committed by GitHub · parent 947fcbb · Browse files · 1 file+1 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−0 removed

  • other:+1 added−0 removed

1 file+1 added−0 removed

modified:src/jv_aux.c+1 added
747 unmodified lines
748 jv curr_key = jv_invalid();749 for (int i = 0; i < n; i++) {750 if (jv_equal(jv_copy(curr_key), jv_copy(entries[i].key))) {751 jv_free(entries[i].key);752 jv_free(entries[i].object);753 } else {754 jv_free(curr_key);755 curr_key = entries[i].key;756 ret = jv_array_append(ret, entries[i].object);
6 unmodified lines