Check for NULL allocation

pull/6/head
Shawn Webb 11 years ago
parent 99ee2138c4
commit 25a64ec0e1
  1. 4
      libclamav/fmap.c

@ -255,6 +255,10 @@ extern cl_fmap_t *cl_fmap_open_handle(void *handle, size_t offset, size_t len,
#endif /* ANONYMOUS_MAP */
if (!use_aging) {
m = (fmap_t *)cli_malloc(mapsz);
if (!(m)) {
cli_warnmsg("fmap: map allocation failed\n");
return NULL;
}
memset(m, 0, hdrsz);
}
if(!m) {

Loading…
Cancel
Save