From 135eb6eb638af9b7251de4b55380fe0999f2e8e0 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 3 Jul 2010 14:05:20 +0200 Subject: [PATCH] src/utils_cache.c: Don't free "name_copy" twice. It's been freed unconditionally above, so there is no need to call free again. This didn't result in an error since "sfree" NULLs the pointer. --- src/utils_cache.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/utils_cache.c b/src/utils_cache.c index 37b8ae8f..7a08a314 100644 --- a/src/utils_cache.c +++ b/src/utils_cache.c @@ -168,7 +168,6 @@ static int uc_send_notification (const char *name) if (type_instance != NULL) sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance)); - /* Copy the associative members */ notification_init (&n, NOTIF_FAILURE, /* host = */ NULL, host, plugin, plugin_instance, type, type_instance); @@ -176,7 +175,6 @@ static int uc_send_notification (const char *name) sfree (name_copy); name_copy = host = plugin = plugin_instance = type = type_instance = NULL; - pthread_mutex_lock (&cache_lock); /* @@ -190,7 +188,6 @@ static int uc_send_notification (const char *name) if (status != 0) { pthread_mutex_unlock (&cache_lock); - sfree (name_copy); return (-1); } @@ -199,7 +196,6 @@ static int uc_send_notification (const char *name) { ce->state = STATE_OKAY; pthread_mutex_unlock (&cache_lock); - sfree (name_copy); return (-1); } -- 2.11.0