]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
fix right ptr for out of memory
authorBastian Dehn <hhaalo@arcor.de>
Mon, 29 Apr 2024 13:57:55 +0000 (15:57 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 29 Apr 2024 13:57:55 +0000 (15:57 +0200)
src/kds_s2000w_client.c

index e6655205147d547c815141011818e74c4f493615..35e748cbfd46a4928a64a4a1adde6bf233dfaef9 100644 (file)
@@ -40,7 +40,7 @@ size_t _kds_s2000w_client_callback(char *ptr, size_t size, size_t nmemb, void *u
        data = (response*) userdata;
        fullsize = size * nmemb;
        new_data_ptr = realloc(data->data, data->size + fullsize + sizeof(char));
-       if (!data->data)
+       if (!new_data_ptr)
                return 0;
 
        data->data = new_data_ptr;