char *slash, *dot;
int dlen = 0, flen = 0;
+ EINA_SAFETY_ON_NULL_GOTO(surface, done);
+ EINA_SAFETY_ON_NULL_GOTO(path, done);
+
slash = strrchr(path, '/');
+ if (slash == NULL)
+ {
+ ERR("cannot find /");
+ goto done;
+ }
slash += 1;
dlen = strnlen(path, PATH_MAX) - strnlen(slash, PATH_MAX);
dir[dlen] = '\0';
dot = strrchr(path, '.');
+ if (dot == NULL)
+ {
+ ERR("cannot find .");
+ goto done;
+ }
flen = strnlen(slash, PATH_MAX) - strnlen(dot, PATH_MAX);
if (flen <= 0)
DBG("_e_info_server_cb_screen_dump_cb done");
done:
- free(path);
- tbm_surface_destroy(surface);
+ if (path != NULL)
+ free(path);
+ if (surface != NULL)
+ tbm_surface_destroy(surface);
}
static Eldbus_Message *