1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2024-11-24 08:12:38 +02:00

Fix memory leak

This commit is contained in:
DarthSim 2017-10-05 05:56:42 +06:00
parent 55b972106c
commit e41a4ab13e
2 changed files with 6 additions and 1 deletions

View File

@ -257,7 +257,7 @@ func processImage(data []byte, imgtype imageType, po processingOptions, t *timer
// Finally, save
var ptr unsafe.Pointer
defer C.g_free(C.gpointer(ptr))
defer C.g_free_go(&ptr)
imgsize := C.size_t(0)

5
vips.h
View File

@ -26,6 +26,11 @@ clear_image(VipsImage **in) {
g_clear_object(in);
}
void
g_free_go(void **buf) {
g_free(*buf);
}
VipsAccess
access_mode(int random) {
if (random > 0) return VIPS_ACCESS_RANDOM;