Skip to content
Myr

fix double free (found by cppcheck)

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

authored by Philipp Wiesemann · committed by Philipp Wiesemann · parent 22fa9a4 · Browse files · 1 file+1 added−1 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−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:stb.h+1 added-1 removed
10050 unmodified lines
10051 fclose(f);10052 if (p == NULL) return NULL;10053 if (p[0] != 0x57 || p[1] != 0xBc || p[2] || p[3]) { free(p); return NULL; }10054 q = (char *) malloc(stb_decompress_length(p)+1);10055 if (!q) { free(p); free(p); return NULL; }10055 if (!q) { free(p); return NULL; }10056 *len = stb_decompress((unsigned char *) q, p, n);10057 if (*len) q[*len] = 0;10058 free(p);10059 return q;
4021 unmodified lines