edje convert - make realloc fatal and complain about it
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Mon, 24 Jul 2017 04:09:26 +0000 (13:09 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Mon, 24 Jul 2017 04:09:26 +0000 (13:09 +0900)
cleaner error handling

src/bin/edje/edje_convert.c

index 1a304a1..eb113a7 100644 (file)
@@ -192,7 +192,11 @@ _edje_collection_program_add(Edje_Program ***array,
    Edje_Program **tmp;
 
    tmp = realloc(*array, sizeof (Edje_Program*) * (*count + 1));
-   if (!tmp) return;
+   if (!tmp)
+     {
+        error_and_abort(ef, "Not enough memory");
+        return;
+     }
 
    tmp[(*count)++] = add;
    *array = tmp;