diff options
author | Nikias Bassen | 2022-04-04 06:43:41 +0200 |
---|---|---|
committer | Nikias Bassen | 2022-04-04 06:43:41 +0200 |
commit | 0da2aa35f2bdfd5b06fc4564a46298a5d689c4fa (patch) | |
tree | a56fc8a5aa004e0d00eab9659e2218673b01bdac | |
parent | 17a2b964ca9c94f6615994ba2179bf4228e31236 (diff) | |
download | libimobiledevice-glue-0da2aa35f2bdfd5b06fc4564a46298a5d689c4fa.tar.gz libimobiledevice-glue-0da2aa35f2bdfd5b06fc4564a46298a5d689c4fa.tar.bz2 |
utils: Close file if buffer allocation fails in buffer_read_from_filename()
Thanks @demhademha for pointing this out.
-rw-r--r-- | src/utils.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c index af12aa5..f3d7bdc 100644 --- a/src/utils.c +++ b/src/utils.c @@ -280,6 +280,7 @@ LIBIMOBILEDEVICE_GLUE_API int buffer_read_from_filename(const char *filename, ch *buffer = (char*)malloc(sizeof(char)*(size+1)); if (*buffer == NULL) { + fclose(f); return 0; } |