[WGID-279204] Fix a potential memory leak problem
[platform/core/connectivity/zigbee-manager.git] / zigbee-daemon / zigbee-lib / src / zblib_plugin.c
index d8ce3a9..48de467 100644 (file)
@@ -44,6 +44,8 @@ ZigBeePlugin *zblib_plugin_new(ZigBeeService *service,
 
        /* Allocate memory */
        plugin = g_malloc0(sizeof(ZigBeePlugin));
+       if (NULL == plugin)
+               return NULL;
 
        /* Update fields */
        plugin->plugin_name = g_strdup(plugin_name);