Skip to content
Myr

Make sure to free in jv_string_indexes

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

authored by Muh Muhten · committed by Muh Muhten · parent 88613f5 · Browse files · 1 file+6 added−6 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+6 added−6 removed

  • other:+6 added−6 removed

1 file+6 added−6 removed

modified:src/jv.c+6 added-6 removed
656 unmodified lines
657 int jlen = jv_string_length_bytes(jv_copy(j));658 int idxlen = jv_string_length_bytes(jv_copy(k));659 jv a = jv_array();660661 if (idxlen == 0)662 return a;663 p = jstr;664 while ((p = _jq_memmem(p, (jstr + jlen) - p, idxstr, idxlen)) != NULL) {665 a = jv_array_append(a, jv_number(p - jstr));666 p += idxlen;661 if (idxlen != 0) {662 p = jstr;663 while ((p = _jq_memmem(p, (jstr + jlen) - p, idxstr, idxlen)) != NULL) {664 a = jv_array_append(a, jv_number(p - jstr));665 p += idxlen;666 }667 }668 jv_free(j);669 jv_free(k);670 return a;
685 unmodified lines