all repos — openbox @ 122e2a81d3899f918de81a735061776193ddeed8

openbox fork - make it a bit more like ryudo

Some fixes found by coverity for things used before a null check

In the second case, we actually check the wrong variable.
Mikael Magnusson mikachu@gmail.com
commit

122e2a81d3899f918de81a735061776193ddeed8

parent

1491e196f3d05152fab127eb9cff3146a68a20a8

2 files changed, 4 insertions(+), 3 deletions(-)

jump to
M obrender/image.cobrender/image.c

@@ -243,7 +243,7 @@ RrImagePic **original, **resized;

gint n_original, n_resized, tmp; GSList *it; - const gint max_resized = a->cache->max_resized_saved; + gint max_resized; if (!a) return b;

@@ -251,7 +251,6 @@ if (!b)

return a; if (a == b) return b; - /* the original and resized picture lists in an RrImageSet are kept ordered as newest to oldest. we don't have timestamps for them, so we cannot preserve this in the merged RrImageSet exactly. a decent approximation,

@@ -263,6 +262,8 @@ from whichever has more resized pictures.

*/ g_assert(b->cache == a->cache); + + max_resized = a->cache->max_resized_saved; a_i = b_i = merged_i = 0; n_original = a->n_original + b->n_original;
M obt/xml.cobt/xml.c

@@ -281,7 +281,7 @@

xmlResetLastError(); i->doc = xmlParseMemory(data, len); - if (i) { + if (i->doc) { i->root = xmlDocGetRootElement(i->doc); if (!i->root) { xmlFreeDoc(i->doc);