From a1963ec3717e1e652de9d10311077a454d9bb8e9 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Thu, 29 Nov 2018 00:32:05 +0100 Subject: utils: Fix free on invalid pointer Credit to tjps see: #100 https://github.com/libimobiledevice/usbmuxd/pull/100 --- src/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.c b/src/utils.c index e30a0b3..206c684 100644 --- a/src/utils.c +++ b/src/utils.c @@ -245,7 +245,7 @@ int buffer_read_from_filename(const char *filename, char **buffer, uint64_t *len int ret = 1; if (fread(*buffer, sizeof(char), size, f) != size) { usbmuxd_log(LL_ERROR, "%s: ERROR: couldn't read %d bytes from %s", __func__, (int)size, filename); - free(buffer); + free(*buffer); ret = 0; errno = EIO; } -- cgit v1.1-32-gdbae