summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2016-12-24 18:22:02 +0100
committerPali Rohár <pali.rohar@gmail.com>2016-12-24 18:22:02 +0100
commitb4314bce152c52ee49ccc9f9a318390ec686bf2a (patch)
tree26cb21898e4c2f34d3cc0e9796c0e0f6fccf17cd
parent117d0bb2d04df5a6cb0289f00afe61671376f0ec (diff)
download0xFFFF-b4314bce152c52ee49ccc9f9a318390ec686bf2a.tar.bz2
cal: Fix pointer check
-rw-r--r--src/cal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cal.c b/src/cal.c
index 25bb9ee..4d07e5e 100644
--- a/src/cal.c
+++ b/src/cal.c
@@ -284,7 +284,7 @@ int cal_read_block(struct cal * cal, const char * name, void ** ptr, unsigned lo
return -1;
*ptr = malloc(hdr->length);
- if (!ptr)
+ if (!*ptr)
return -1;
memcpy(*ptr, offset, hdr->length);