diff --git a/lib/fko_util.c b/lib/fko_util.c index 8d299fa0..e70e6eab 100644 --- a/lib/fko_util.c +++ b/lib/fko_util.c @@ -404,9 +404,15 @@ int zero_free(char *buf, int len) { int res = FKO_SUCCESS; - if(buf == NULL || len == 0) + if(buf == NULL) return res; + if(len == 0) + { + free(buf); /* always free() if buf != NULL */ + return res; + } + res = zero_buf(buf, len); free(buf);