plugin: not return -1 if plugin_flush_callback_name fails
authorManuel Luis Sanmartín Rozada <manuel.luis@gmail.com>
Mon, 8 Jun 2015 19:36:05 +0000 (21:36 +0200)
committerManuel Luis Sanmartín Rozada <manuel.luis@gmail.com>
Mon, 8 Jun 2015 19:36:05 +0000 (21:36 +0200)
src/daemon/plugin.c

index ea9d2e9..88a2af4 100644 (file)
@@ -1625,11 +1625,11 @@ int plugin_unregister_flush (const char *name)
                char *flush_name;
 
                flush_name = plugin_flush_callback_name (name);
-               if (flush_name == NULL)
-                       return (-1);
-
-               plugin_unregister_read(flush_name);
-               sfree(flush_name);
+               if (flush_name != NULL)
+               {
+                       plugin_unregister_read(flush_name);
+                       sfree(flush_name);
+               }
        }
 
        return plugin_unregister (list_flush, name);