From: Bastian Dehn Date: Sun, 5 Jan 2025 18:57:46 +0000 (+0100) Subject: add null check for free handler X-Git-Tag: v1.0.24^2~1 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=4c5da572140a5b88a4e508211e82bdf84167da2b;p=sane-kds-s2000w-net.git add null check for free handler --- diff --git a/src/kds_s2000w_handler.c b/src/kds_s2000w_handler.c index 2f19998..dd38584 100644 --- a/src/kds_s2000w_handler.c +++ b/src/kds_s2000w_handler.c @@ -65,6 +65,9 @@ void free_handler(handler* h) { debug_printf(ALL, "free handler"); + if (h == NULL) + return; + json_object_put(h->current_scanner_config); h->current_scanner_config = NULL; free(h->current_scan_status); @@ -83,6 +86,9 @@ void reset_handler(handler* h) { debug_printf(ALL, "reset handler"); + if (h == NULL) + return; + free(h->image->data); h->image->data = NULL;