diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2019-03-18 16:29:43 +0100 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2019-03-18 16:29:43 +0100 |
| commit | 0a77f7a5fbee586e6a05120b087202b84f1a9dc6 (patch) | |
| tree | 35d252c58902a37b14a13bf1660df19f16087510 /src/cc4group.c | |
| parent | d734fc748de81f3d01151ce79cc14b940a799d20 (diff) | |
| download | cc4group-0a77f7a5fbee586e6a05120b087202b84f1a9dc6.tar.gz cc4group-0a77f7a5fbee586e6a05120b087202b84f1a9dc6.zip | |
Check and set error in cc4group_createTmpMemoryMalloc
Diffstat (limited to 'src/cc4group.c')
| -rw-r--r-- | src/cc4group.c | 9 |
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; } |
