summaryrefslogtreecommitdiffstats
path: root/lib/libstand/zipfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libstand/zipfs.c')
-rw-r--r--lib/libstand/zipfs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libstand/zipfs.c b/lib/libstand/zipfs.c
index bcf0ace..61e7215 100644
--- a/lib/libstand/zipfs.c
+++ b/lib/libstand/zipfs.c
@@ -179,6 +179,8 @@ zf_open(const char *fname, struct open_file *f)
/* Construct new name */
zfname = malloc(strlen(fname) + 4);
+ if (zfname == NULL)
+ return(ENOMEM);
sprintf(zfname, "%s.gz", fname);
/* Try to open the compressed datafile */
@@ -200,6 +202,8 @@ zf_open(const char *fname, struct open_file *f)
/* Allocate a z_file structure, populate it */
zf = malloc(sizeof(struct z_file));
+ if (zf == NULL)
+ return(ENOMEM);
bzero(zf, sizeof(struct z_file));
zf->zf_rawfd = rawfd;
OpenPOWER on IntegriCloud