]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
fix memory leaks
authorBastian Dehn <hhaalo@arcor.de>
Sun, 21 Jan 2024 13:49:39 +0000 (14:49 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 21 Jan 2024 13:49:39 +0000 (14:49 +0100)
src/kds_s2000w_handler.c
src/kds_s2000w_net.c

index e9bfab558dc3ed9824b3e24e9841afc2fba075bc..eb6bec416e18de3da394794e5ee788e661513069 100644 (file)
@@ -45,7 +45,7 @@ device_state kds_s2000w_handler_open()
        curl_easy_setopt(curl, CURLINFO_RESPONSE_CODE, &resp.code);
        CURLcode result = curl_easy_perform(curl);
 
-       json_object* resObj;
+       json_object* resObj = NULL;
        if (result != CURLE_OK || resp.code == 404)
                returnState = NOTCONNECTED;
 
index 219ebacecea01d9a244e58a9b22b2c62e3a1cea2..dac9848778ccc1aae022a40c301691032d0b09cb 100644 (file)
@@ -4,7 +4,7 @@
 #include <sane/sane.h>
 #include "kds_s2000w_handler.h"
 
-SANE_Device* device_info;
+SANE_Device* device_info = NULL;
 
 SANE_Status _sane_kds_s2000w_net_init(SANE_Int* version_code, SANE_Auth_Callback authorize)
 {