From 83608e80322642e681918a647ef54a67e7bb15a3 Mon Sep 17 00:00:00 2001 From: rimio Date: Mon, 7 Jan 2019 17:41:03 +0200 Subject: Some changes --- src/sstv.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/sstv.c') diff --git a/src/sstv.c b/src/sstv.c index a29acd3..e91ae2b 100644 --- a/src/sstv.c +++ b/src/sstv.c @@ -13,6 +13,11 @@ sstv_free_t sstv_free_user = NULL; sstv_error_t sstv_init(sstv_malloc_t alloc_func, sstv_free_t dealloc_func) { + /* Check that either both or none of the functions are provided */ + if ((!alloc_func && dealloc_func) || (alloc_func && !dealloc_func)) { + return SSTV_BAD_INITIALIZERS; + } + /* Keep user functions for allocation/deallocation */ sstv_malloc_user = alloc_func; sstv_free_user = dealloc_func; -- cgit v1.2.3