Fix klockwork error: Null pointer may be dereferenced
authorChris Michael <cp.michael@samsung.com>
Fri, 28 Jun 2013 12:48:21 +0000 (13:48 +0100)
committerChris Michael <cp.michael@samsung.com>
Fri, 28 Jun 2013 12:48:21 +0000 (13:48 +0100)
Check for valid out_file before trying to use it.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/bin/edje/edje_pick.c

index ea8a199..c0ea301 100644 (file)
@@ -1347,8 +1347,9 @@ main(int argc, char **argv)
    _edje_pick_sound_dir_compose(samples, tones, out_file);
 
    /* Write file header after processing all groups */
-   bytes = eet_data_write(out_file->ef, _edje_edd_edje_file, "edje/file",
-                          out_file, comp_mode);
+   if (out_file)
+     bytes = eet_data_write(out_file->ef, _edje_edd_edje_file, "edje/file",
+                            out_file, comp_mode);
 
    VERBOSE(EINA_LOG_INFO("Wrote <%d> bytes for file header.\n", bytes));