feat: squash another leak?
This commit is contained in:
parent
df64451be2
commit
b961628a77
15
src/mumble.c
15
src/mumble.c
|
@ -196,17 +196,28 @@ void delete_lispval(lispval* v)
|
||||||
case LISPVAL_QEXPR:
|
case LISPVAL_QEXPR:
|
||||||
if (VERBOSE)
|
if (VERBOSE)
|
||||||
printfln("Freeing sexpr|qexpr");
|
printfln("Freeing sexpr|qexpr");
|
||||||
if (v == NULL || v->count != 0)
|
// if (v == NULL || v->count != 0)
|
||||||
return;
|
// return;
|
||||||
|
if (VERBOSE)
|
||||||
|
printfln("Freed sexpr|qexpr cells");
|
||||||
for (int i = 0; i < v->count; i++) {
|
for (int i = 0; i < v->count; i++) {
|
||||||
if (v->cell[i] != NULL)
|
if (v->cell[i] != NULL)
|
||||||
delete_lispval(v->cell[i]);
|
delete_lispval(v->cell[i]);
|
||||||
v->cell[i] = NULL;
|
v->cell[i] = NULL;
|
||||||
}
|
}
|
||||||
|
if (VERBOSE)
|
||||||
|
printfln("Setting v->count to 0");
|
||||||
v->count = 0;
|
v->count = 0;
|
||||||
|
|
||||||
|
if (VERBOSE)
|
||||||
|
printfln("Freeing v->cell");
|
||||||
if (v->cell != NULL)
|
if (v->cell != NULL)
|
||||||
free(v->cell);
|
free(v->cell);
|
||||||
v->cell = NULL;
|
v->cell = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
if (VERBOSE)
|
||||||
|
printfln("Freeing the v pointer");
|
||||||
if (v != NULL)
|
if (v != NULL)
|
||||||
free(v);
|
free(v);
|
||||||
if (VERBOSE)
|
if (VERBOSE)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user