From: Bastian Dehn Date: Wed, 15 Oct 2025 08:08:14 +0000 (+0200) Subject: fix out of mem alloc in handler X-Git-Tag: v1.1.12^2~1 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=024b1e311169180764b44bca66e8dac18606ec5c;p=sane-kds-s2000w-net.git fix out of mem alloc in handler --- diff --git a/src/kds_s2000w_handler.c b/src/kds_s2000w_handler.c index 3a610ae..173d7c6 100644 --- a/src/kds_s2000w_handler.c +++ b/src/kds_s2000w_handler.c @@ -40,6 +40,8 @@ uint32_t _kds_s2000w_handler_find_first_data_byte(const imagedata* image) client_config_t* _kds_s2000w_handler_convert_config(program_config* config) { client_config_t* client_config = malloc(sizeof(client_config_t)); + if (client_config == NULL) + return NULL; client_config->scanner_url = config->scanner_url; client_config->username = config->username; @@ -62,6 +64,9 @@ void _kds_s2000w_handler_load_config(handler* h) return; client_config_t* client_config = _kds_s2000w_handler_convert_config(config); + if (client_config == NULL) + return; + kds_s2000w_client_init(client_config); kds_s2000w_debug_set_default_log_level(config->log_level); h->profile = config->profile;