summaryrefslogtreecommitdiff
path: root/src/sstv.c
diff options
context:
space:
mode:
authorrimio <vasi.vilvoiu@gmail.com>2019-01-07 17:41:03 +0200
committerrimio <vasi.vilvoiu@gmail.com>2019-01-07 17:41:03 +0200
commit83608e80322642e681918a647ef54a67e7bb15a3 (patch)
tree45dd8abf5896e3dea959031664d923ae28da2dbe /src/sstv.c
parentdf66a60b90200b020c3e32a2a6302971b254bbd0 (diff)
Some changes
Diffstat (limited to 'src/sstv.c')
-rw-r--r--src/sstv.c5
1 files changed, 5 insertions, 0 deletions
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;