[DF181127-00018]Segmentation fault issue handled 45/194145/2 accepted/tizen/unified/20181130.065001 submit/tizen/20181129.095451
authoralkasethi <alka.sethi@samsung.com>
Thu, 29 Nov 2018 09:00:46 +0000 (14:30 +0530)
committeralkasethi <alka.sethi@samsung.com>
Thu, 29 Nov 2018 09:04:29 +0000 (14:34 +0530)
Change-Id: I27833062caf987d086e9c57a6b8d70a7c22b4972

src/plugin.c

index 9c5058cbe3d567974fc79322b87663ab459fc5dc..222bf8a5b33112bb3d6d6956224dd93a6506a2d6 100644 (file)
@@ -221,17 +221,21 @@ int request_sync_cmd ( int cmd, parameters* in, parameters* out )
     out->number_of_parameter = 0;
     out->array_of_parameter = NULL;
 
-    ret = hashtable_get ( plugin_cmd_hashtable, cmd, &pr );
-    if ( ret == 1 ) {
-        // supported by plugin
-        ret = plugin_sync_proc ( cmd, in, out );
-        if ( ret == PLUGIN_CMD_NOT_SUPPORT ) {
-            // not supported by plugin
-            ret = default_plugin_sync_proc ( cmd, in, out );
-        }
+    if ( plugin_cmd_hashtable ) {
+       ret = hashtable_get ( plugin_cmd_hashtable, cmd, &pr );
+       if ( ret == 1 ) {
+               // supported by plugin
+               ret = plugin_sync_proc ( cmd, in, out );
+               if ( ret == PLUGIN_CMD_NOT_SUPPORT ) {
+                       // not supported by plugin
+                       ret = default_plugin_sync_proc ( cmd, in, out );
+               }
+       } else {
+               // not supported by plugin
+               ret = default_plugin_sync_proc ( cmd, in, out );
+       }
     } else {
-        // not supported by plugin
-        ret = default_plugin_sync_proc ( cmd, in, out );
+       ret = default_plugin_sync_proc ( cmd, in, out );
     }
 
     return ret;
@@ -241,17 +245,21 @@ static void request_async_cmd ( int cmd, parameters* in, int out_fd )
 {
     int ret, pr;
 
-    ret = hashtable_get ( plugin_cmd_hashtable, cmd, &pr );
-    if ( ret == 1 ) {
-        // supported by plugin
-        ret = plugin_async_proc ( cmd, in, out_fd );
-        if ( ret == PLUGIN_CMD_NOT_SUPPORT ) {
-            // not supported by plugin
-            ret = default_plugin_async_proc ( cmd, in, out_fd );
-        }
+    if ( plugin_cmd_hashtable ) {
+       ret = hashtable_get ( plugin_cmd_hashtable, cmd, &pr );
+       if ( ret == 1 ) {
+               // supported by plugin
+               ret = plugin_async_proc ( cmd, in, out_fd );
+               if ( ret == PLUGIN_CMD_NOT_SUPPORT ) {
+                       // not supported by plugin
+                       ret = default_plugin_async_proc ( cmd, in, out_fd );
+               }
+       } else {
+               // not supported by plugin
+               ret = default_plugin_async_proc ( cmd, in, out_fd );
+       }
     } else {
-        // not supported by plugin
-        ret = default_plugin_async_proc ( cmd, in, out_fd );
+       ret = default_plugin_async_proc ( cmd, in, out_fd );
     }
 
     release_parameters(in);