aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/3rdparty
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/3rdparty')
-rw-r--r--src/libjin/3rdparty/smount/smount.c12
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);