test malloc/calloc's return. Fix CID1436182

terminology-1.9
Boris Faure 2 years ago
parent 7465f46a9f
commit c2cd0035e4
Signed by: borisfaure
GPG Key ID: 35C0410516166BE8
  1. 9
      src/bin/keyin.c
  2. 9
      src/bin/options_background.c

@ -401,9 +401,12 @@ cb_term_new(Evas_Object *termio_obj)
length = (strlen(path) + strlen(cwd) + strlen(template) - 3);
cmd = malloc(sizeof(char) * length);
snprintf(cmd, length, template, path, cwd);
ecore_exe_run(cmd, NULL);
free(cmd);
if (cmd)
{
snprintf(cmd, length, template, path, cwd);
ecore_exe_run(cmd, NULL);
free(cmd);
}
}
else
{

@ -303,10 +303,10 @@ _rec_read_directorys(Background_Ctx *ctx, Eina_List *list,
item = calloc(1, sizeof(Background_Item));
if (item)
{
notify = calloc(1,
sizeof(Insert_Gen_Grid_Item_Notify));
item->path = eina_stringshare_add(path);
list = eina_list_append(list, item);
notify = calloc(1,
sizeof(Insert_Gen_Grid_Item_Notify));
if (notify)
{
//insert item to gengrid
@ -350,6 +350,11 @@ _refresh_directory(Background_Ctx *ctx, const char* data)
item_class->func.content_get = _grid_content_get;
item = calloc(1, sizeof(Background_Item));
if (!item)
{
elm_gengrid_item_class_free(item_class);
return;
}
ctx->background_list = eina_list_append(ctx->background_list, item);
//Insert None Item

Loading…
Cancel
Save