From: alkasethi Date: Thu, 29 Nov 2018 09:00:46 +0000 (+0530) Subject: [DF181127-00018]Segmentation fault issue handled X-Git-Tag: submit/tizen/20181129.095451^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e03fe1f9d66ba0920f6636fc2d2b9ffc6bcaf5a1;p=sdk%2Ftarget%2Fsdbd.git [DF181127-00018]Segmentation fault issue handled Change-Id: I27833062caf987d086e9c57a6b8d70a7c22b4972 --- diff --git a/src/plugin.c b/src/plugin.c index 9c5058c..222bf8a 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -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);