From f50040e4752e1097fac793bb82569c63a6c09ee9 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 20 Aug 2018 19:16:47 +0800 Subject: *update --- src/libjin/3rdparty/smount/smount.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/libjin/3rdparty') diff --git a/src/libjin/3rdparty/smount/smount.c b/src/libjin/3rdparty/smount/smount.c index 3006fa3..2b4e9b9 100644 --- a/src/libjin/3rdparty/smount/smount.c +++ b/src/libjin/3rdparty/smount/smount.c @@ -147,10 +147,18 @@ void *smtread(smtShared* S, const char *path, unsigned int *size) size = (unsigned int*)malloc(sizeof(unsigned int)); } char *r = concat(S->mount->path, "/", path, NULL); - if (!r) return NULL; + if (!r) + { + free(size); + return NULL; + } FILE *fp = fopen(r, "rb"); free(r); - if (!fp) return 0; + if (!fp) + { + free(size); + return 0; + } /* Get file size */ fseek(fp, 0, SEEK_END); *size = ftell(fp); -- cgit v1.1-26-g67d0