summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2018-11-29 00:32:05 +0100
committerGravatar Nikias Bassen2018-11-29 00:32:05 +0100
commita1963ec3717e1e652de9d10311077a454d9bb8e9 (patch)
treee7e2de461c56b4a13d41cf3daff2da719ff8ffe8
parent9a93f8727414c33f9efa5448b468533a347cf519 (diff)
downloadusbmuxd-a1963ec3717e1e652de9d10311077a454d9bb8e9.tar.gz
usbmuxd-a1963ec3717e1e652de9d10311077a454d9bb8e9.tar.bz2
utils: Fix free on invalid pointer
Credit to tjps see: #100 https://github.com/libimobiledevice/usbmuxd/pull/100
-rw-r--r--src/utils.c2
1 files changed, 1 insertions, 1 deletions
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;
}