diff options
author | chai <chaifix@163.com> | 2018-08-20 19:16:47 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-08-20 19:16:47 +0800 |
commit | f50040e4752e1097fac793bb82569c63a6c09ee9 (patch) | |
tree | 8aa2131628f93d6eb3db53e11ac7fb986c79b8c0 /src/libjin/3rdparty/smount/smount.c | |
parent | 79b35943dc3f5dbb0028b29e4745390204daf125 (diff) |
*update
Diffstat (limited to 'src/libjin/3rdparty/smount/smount.c')
-rw-r--r-- | src/libjin/3rdparty/smount/smount.c | 12 |
1 files changed, 10 insertions, 2 deletions
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); |