Commit f765f65e authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen
Browse files

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)
parent a052fd12
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
......
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
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment