diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2006-05-13 18:51:21 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2006-05-13 18:51:21 +0000 |
commit | 2305ff869ebf629dc1f5913d3c0b46cb6d9efb08 (patch) | |
tree | 28c454b0b4420ac2c6c24b57a54d85ea9341d7df /pango/pango-item.c | |
parent | 009421e841fe06cb88936eb9a8c62346c97bd137 (diff) | |
download | pango-2305ff869ebf629dc1f5913d3c0b46cb6d9efb08.tar.gz |
Don't copy item before g_return_if_fail'ing it for NULL. (Coverity issue
2006-05-13 Behdad Esfahbod <behdad@gnome.org>
* pango/pango-item.c (pango_item_split): Don't copy item before
g_return_if_fail'ing it for NULL. (Coverity issue id=18509&runid=43)
Diffstat (limited to 'pango/pango-item.c')
-rw-r--r-- | pango/pango-item.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pango/pango-item.c b/pango/pango-item.c index 37622e87..54d0f52e 100644 --- a/pango/pango-item.c +++ b/pango/pango-item.c @@ -134,7 +134,7 @@ pango_item_split (PangoItem *orig, int split_index, int split_offset) { - PangoItem *new_item = pango_item_copy (orig); + PangoItem *new_item; g_return_val_if_fail (orig != NULL, NULL); g_return_val_if_fail (orig->length > 0, NULL); @@ -143,6 +143,7 @@ pango_item_split (PangoItem *orig, g_return_val_if_fail (split_offset > 0, NULL); g_return_val_if_fail (split_offset < orig->num_chars, NULL); + new_item = pango_item_copy (orig); new_item->length = split_index; new_item->num_chars = split_offset; |