fix a few potential use-before-check errors

Spotted by Andrey Karpov using static code analysis:
   http://www.viva64.com/en/b/0273/
This commit is contained in:
Simon Budig 2014-08-16 00:29:16 +02:00
parent a102690145
commit 7928be2255
3 changed files with 5 additions and 4 deletions

View File

@ -893,7 +893,7 @@ update_preview (gint32 *id_ptr)
if (g_Sdebug)
printf ("UPD PREVIEWS ID:%d ENABLE_UPD:%d\n",
(int)*id_ptr, (int)g_di.enable_preview_update);
id_ptr ? (int) *id_ptr : -1, (int)g_di.enable_preview_update);
if (id_ptr == NULL || !g_di.enable_preview_update)
return;

View File

@ -1505,8 +1505,7 @@ add_layers (gint32 image_id,
gimp_layer_set_apply_mask (layer_id,
! lyr_a[lidx]->layer_mask.mask_flags.disabled);
}
if (pixels)
g_free (pixels);
g_free (pixels);
}
}
for (cidx = 0; cidx < lyr_a[lidx]->num_channels; ++cidx)

View File

@ -533,9 +533,11 @@ ObjectList_t*
object_list_append_list(ObjectList_t *des, ObjectList_t *src)
{
GList *p;
if (!src)
return des;
for (p = src->list; p; p = p->next)
object_list_append(des, object_clone((Object_t*) p->data));
object_list_set_changed(des, (src) ? TRUE : FALSE);
object_list_set_changed(des, TRUE);
return des;
}