Skip to content

Commit c6401b0

Browse files
committed
Fix leakage
1 parent c453e0d commit c6401b0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/addon_encode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ encode_enumerable(napi_env env, napi_value value, bool is_array, lite3_ctx *ctx,
4848
free(key_str);
4949
return status;
5050
}
51-
// We don't free key_str here because lite3_ctx_set_* takes ownership of the string
51+
free(key_str);
5252
}
5353

5454
return napi_ok;
@@ -92,7 +92,7 @@ encode_element(napi_env env, char *key_name, napi_value value, bool parent_is_ar
9292
return napi_generic_failure;
9393
}
9494
}
95-
// We do not free str here, as lite3_ctx_set_str takes ownership of it
95+
free(str);
9696
return napi_ok;
9797
}
9898

0 commit comments

Comments
 (0)