summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarkus Mittendrein <git@maxmitti.tk>2019-03-18 16:29:43 +0100
committerMarkus Mittendrein <git@maxmitti.tk>2019-03-18 16:29:43 +0100
commit0a77f7a5fbee586e6a05120b087202b84f1a9dc6 (patch)
tree35d252c58902a37b14a13bf1660df19f16087510 /src
parentd734fc748de81f3d01151ce79cc14b940a799d20 (diff)
downloadcc4group-0a77f7a5fbee586e6a05120b087202b84f1a9dc6.tar.gz
cc4group-0a77f7a5fbee586e6a05120b087202b84f1a9dc6.zip
Check and set error in cc4group_createTmpMemoryMalloc
Diffstat (limited to 'src')
-rw-r--r--src/cc4group.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cc4group.c b/src/cc4group.c
index 43a22b5..85c1be4 100644
--- a/src/cc4group.c
+++ b/src/cc4group.c
@@ -366,7 +366,14 @@ static void* cc4group_createTmpMemoryMalloc(CC4Group* const this, const size_t s
// error checking is left out intentionally. it is the job of the calling function
void* ret = malloc(size);
- *cleanupJob = (CC4Group_CleanupJob){free, ret};
+ if(ret == NULL)
+ {
+ SET_ERRNO_ERROR("malloc: allocating tmp memory");
+ }
+ else
+ {
+ *cleanupJob = (CC4Group_CleanupJob){free, ret};
+ }
return ret;
}