Fix several cases of deref-before-NULL-check. (#341191, Pascal Terjan)

2006-05-13  Matthias Clasen  <mclasen@redhat.com>

	* glib/grel.c: Fix several cases of deref-before-NULL-check.
	(#341191, Pascal Terjan)
This commit is contained in:
Matthias Clasen 2006-05-13 04:36:45 +00:00 committed by Matthias Clasen
parent a052fd1202
commit f765f65eda
3 changed files with 22 additions and 5 deletions

View File

@ -1,5 +1,8 @@
2006-05-13 Matthias Clasen <mclasen@redhat.com>
* glib/grel.c: Fix several cases of deref-before-NULL-check.
(#341191, Pascal Terjan)
* glib/glib.symbols:
* glib/goption.h:
* glib/goption.c: Allow optional summary and description

View File

@ -1,5 +1,8 @@
2006-05-13 Matthias Clasen <mclasen@redhat.com>
* glib/grel.c: Fix several cases of deref-before-NULL-check.
(#341191, Pascal Terjan)
* glib/glib.symbols:
* glib/goption.h:
* glib/goption.c: Allow optional summary and description

View File

@ -252,11 +252,15 @@ g_relation_delete (GRelation *relation,
gconstpointer key,
gint field)
{
GHashTable *table = relation->hashed_tuple_tables[field];
GHashTable *table;
GHashTable *key_table;
gint count = relation->count;
gint count;
g_return_val_if_fail (relation != NULL, 0);
table = relation->hashed_tuple_tables[field];
count = relation->count;
g_return_val_if_fail (table != NULL, 0);
key_table = g_hash_table_lookup (table, key);
@ -300,14 +304,18 @@ g_relation_select (GRelation *relation,
gconstpointer key,
gint field)
{
GHashTable *table = relation->hashed_tuple_tables[field];
GHashTable *table;
GHashTable *key_table;
GRealTuples *tuples = g_new0 (GRealTuples, 1);
GRealTuples *tuples;
gint count;
g_return_val_if_fail (relation != NULL, NULL);
table = relation->hashed_tuple_tables[field];
g_return_val_if_fail (table != NULL, NULL);
tuples = g_new0 (GRealTuples, 1);
key_table = g_hash_table_lookup (table, key);
if (!key_table)
@ -330,10 +338,13 @@ g_relation_count (GRelation *relation,
gconstpointer key,
gint field)
{
GHashTable *table = relation->hashed_tuple_tables[field];
GHashTable *table;
GHashTable *key_table;
g_return_val_if_fail (relation != NULL, 0);
table = relation->hashed_tuple_tables[field];
g_return_val_if_fail (table != NULL, 0);
key_table = g_hash_table_lookup (table, key);