aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-03-02 10:54:50 -0600
committerTed Gould <ted@gould.cx>2012-03-02 10:54:50 -0600
commitc3bd07e8e6679bbda00737b81b2397b93ec5a723 (patch)
tree5304dba6a569331f25442344e765aed76017aada
parentdbaf540c033c3a1e296834be94dd0893cde88383 (diff)
downloadlibayatana-indicator-c3bd07e8e6679bbda00737b81b2397b93ec5a723.tar.gz
libayatana-indicator-c3bd07e8e6679bbda00737b81b2397b93ec5a723.tar.bz2
libayatana-indicator-c3bd07e8e6679bbda00737b81b2397b93ec5a723.zip
Copying the name before using it to remove as it seems that the unwatch can cause the name to be free'd in some cases. Odd, but valgrind can find it
-rw-r--r--libindicator/indicator-service.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c
index e9f3133..11171fc 100644
--- a/libindicator/indicator-service.c
+++ b/libindicator/indicator-service.c
@@ -588,7 +588,9 @@ unwatch_core (IndicatorService * service, const gchar * name)
/* Remove us from the watcher list here */
gpointer watcher_item = g_hash_table_lookup(priv->watchers, name);
if (watcher_item != NULL) {
- g_hash_table_remove(priv->watchers, name);
+ gchar * safe_name = g_strdup(name);
+ g_hash_table_remove(priv->watchers, safe_name);
+ g_free(safe_name);
} else {
/* Odd that we couldn't find the person, but, eh */
g_warning("Unable to find watcher who is unwatching: %s", name);