]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add null check for free handler
authorBastian Dehn <hhaalo@arcor.de>
Sun, 5 Jan 2025 18:57:46 +0000 (19:57 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 5 Jan 2025 18:57:46 +0000 (19:57 +0100)
src/kds_s2000w_handler.c

index 2f199980dc5803f7801b7ef7fef8f80a359321dd..dd385849d7175dcbac9dfa3b5e17fcb3220e6b5b 100644 (file)
@@ -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;