diff options
| author | Jeffrey Stedfast <fejj@novell.com> | 2006-07-07 15:03:53 +0000 |
|---|---|---|
| committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2006-07-07 15:03:53 +0000 |
| commit | 36ac7709edfdb9053ea3ea67f0c2b4297f24a87c (patch) | |
| tree | a752cc50d8f0d196c52dbdfd6f07c7514063103f /camel | |
| parent | 804db409dac356ed293d3635b5d72bb84ad3bb73 (diff) | |
| download | evolution-data-server-36ac7709edfdb9053ea3ea67f0c2b4297f24a87c.tar.gz | |
If the value is in the table already and 'own' is TRUE, g_free the
2006-07-07 Jeffrey Stedfast <fejj@novell.com>
* camel-string-utils.c (camel_pstring_add): If the value is in the
table already and 'own' is TRUE, g_free the passed-in string.
Diffstat (limited to 'camel')
| -rw-r--r-- | camel/ChangeLog | 5 | ||||
| -rw-r--r-- | camel/camel-string-utils.c | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index a760a329f..3fdb419c5 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,8 @@ +2006-07-07 Jeffrey Stedfast <fejj@novell.com> + + * camel-string-utils.c (camel_pstring_add): If the value is in the + table already and 'own' is TRUE, g_free the passed-in string. + 2006-07-07 Sankar P <psankar@novell.com> * camel-string-utils.c (camel_pstring_add): diff --git a/camel/camel-string-utils.c b/camel/camel-string-utils.c index f5718514b..61137bb37 100644 --- a/camel/camel-string-utils.c +++ b/camel/camel-string-utils.c @@ -180,6 +180,8 @@ camel_pstring_add (char *str, gboolean own) if (g_hash_table_lookup_extended (pstring_table, str, (void **) &pstr, &pcount)) { count = GPOINTER_TO_INT (pcount) + 1; g_hash_table_insert (pstring_table, pstr, GINT_TO_POINTER (count)); + if (own) + g_free (str); } else { pstr = own ? str : g_strdup (str); g_hash_table_insert (pstring_table, pstr, GINT_TO_POINTER (1)); |
