From 1fa5cd3a336e00df36f297650180b811c2564319 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 10 Feb 2021 23:50:26 -0300 Subject: [PATCH] Fixing deepcode alert. --- src/core/util.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/util.c b/src/core/util.c index 2a019a0..6cffa24 100644 --- a/src/core/util.c +++ b/src/core/util.c @@ -180,6 +180,8 @@ LIB3270_EXPORT void lib3270_autoptr_cleanup_LIB3270_POPUP(LIB3270_POPUP **ptr) LIB3270_EXPORT void * lib3270_realloc(void *p, int len) { p = realloc(p, len); + if(p == NULL) + perror("realloc"); return p; } @@ -192,9 +194,10 @@ LIB3270_EXPORT void * lib3270_calloc(int elsize, int nelem, void *ptr) else ptr = malloc(sz); - if(ptr) - memset(ptr,0,sz); + if(!ptr) + perror("calloc"); + memset(ptr,0,sz); return ptr; } -- libgit2 0.21.2