Menu

#31 2-2-3 for unix won't compile, freeing something not on the heap

v1.0_(example)
open
nobody
None
1
2025-05-07
2025-05-07
ptb
No

in src/writer.c there are three free(nativeStream) calls. Uh, uh. It should be free(*nativeStream).

nativeStream is a variable containing a pointer to a pointer. The place it points to is where the pointer from a malloc call is stored. That happens as follows above the free() calls.

nativeStream = (unsigned char ) malloc(*size);

so one has to free(*nativeStream), not free(nativeStream).

[Can somebody bother to make up a debian package, please? I will anyway, but you need to do it.]

Discussion

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB