mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-09 04:15:49 +01:00
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:
parent
a052fd1202
commit
f765f65eda
@ -1,5 +1,8 @@
|
|||||||
2006-05-13 Matthias Clasen <mclasen@redhat.com>
|
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/glib.symbols:
|
||||||
* glib/goption.h:
|
* glib/goption.h:
|
||||||
* glib/goption.c: Allow optional summary and description
|
* glib/goption.c: Allow optional summary and description
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
2006-05-13 Matthias Clasen <mclasen@redhat.com>
|
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/glib.symbols:
|
||||||
* glib/goption.h:
|
* glib/goption.h:
|
||||||
* glib/goption.c: Allow optional summary and description
|
* glib/goption.c: Allow optional summary and description
|
||||||
|
21
glib/grel.c
21
glib/grel.c
@ -252,11 +252,15 @@ g_relation_delete (GRelation *relation,
|
|||||||
gconstpointer key,
|
gconstpointer key,
|
||||||
gint field)
|
gint field)
|
||||||
{
|
{
|
||||||
GHashTable *table = relation->hashed_tuple_tables[field];
|
GHashTable *table;
|
||||||
GHashTable *key_table;
|
GHashTable *key_table;
|
||||||
gint count = relation->count;
|
gint count;
|
||||||
|
|
||||||
g_return_val_if_fail (relation != NULL, 0);
|
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);
|
g_return_val_if_fail (table != NULL, 0);
|
||||||
|
|
||||||
key_table = g_hash_table_lookup (table, key);
|
key_table = g_hash_table_lookup (table, key);
|
||||||
@ -300,14 +304,18 @@ g_relation_select (GRelation *relation,
|
|||||||
gconstpointer key,
|
gconstpointer key,
|
||||||
gint field)
|
gint field)
|
||||||
{
|
{
|
||||||
GHashTable *table = relation->hashed_tuple_tables[field];
|
GHashTable *table;
|
||||||
GHashTable *key_table;
|
GHashTable *key_table;
|
||||||
GRealTuples *tuples = g_new0 (GRealTuples, 1);
|
GRealTuples *tuples;
|
||||||
gint count;
|
gint count;
|
||||||
|
|
||||||
g_return_val_if_fail (relation != NULL, NULL);
|
g_return_val_if_fail (relation != NULL, NULL);
|
||||||
|
|
||||||
|
table = relation->hashed_tuple_tables[field];
|
||||||
|
|
||||||
g_return_val_if_fail (table != NULL, NULL);
|
g_return_val_if_fail (table != NULL, NULL);
|
||||||
|
|
||||||
|
tuples = g_new0 (GRealTuples, 1);
|
||||||
key_table = g_hash_table_lookup (table, key);
|
key_table = g_hash_table_lookup (table, key);
|
||||||
|
|
||||||
if (!key_table)
|
if (!key_table)
|
||||||
@ -330,10 +338,13 @@ g_relation_count (GRelation *relation,
|
|||||||
gconstpointer key,
|
gconstpointer key,
|
||||||
gint field)
|
gint field)
|
||||||
{
|
{
|
||||||
GHashTable *table = relation->hashed_tuple_tables[field];
|
GHashTable *table;
|
||||||
GHashTable *key_table;
|
GHashTable *key_table;
|
||||||
|
|
||||||
g_return_val_if_fail (relation != NULL, 0);
|
g_return_val_if_fail (relation != NULL, 0);
|
||||||
|
|
||||||
|
table = relation->hashed_tuple_tables[field];
|
||||||
|
|
||||||
g_return_val_if_fail (table != NULL, 0);
|
g_return_val_if_fail (table != NULL, 0);
|
||||||
|
|
||||||
key_table = g_hash_table_lookup (table, key);
|
key_table = g_hash_table_lookup (table, key);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user