Fix deference without checking NULL 50/74250/1 accepted/tizen/common/20160614.144121 accepted/tizen/ivi/20160614.103814 accepted/tizen/mobile/20160614.103815 accepted/tizen/tv/20160614.103725 accepted/tizen/wearable/20160614.103731 submit/tizen/20160614.070632
authorWonnam Jang <wn.jang@samsung.com>
Mon, 13 Jun 2016 10:21:37 +0000 (19:21 +0900)
committerWonnam Jang <wn.jang@samsung.com>
Mon, 13 Jun 2016 10:21:37 +0000 (19:21 +0900)
Change-Id: I0a3adc803ebd533e1f2efa8868de0a656eebde34
Signed-off-by: Wonnam Jang <wn.jang@samsung.com>
common/vc_info_parser.c

index b6e7142..cc1af86 100644 (file)
@@ -1676,6 +1676,9 @@ int __vc_cmd_parser_print_commands(GSList* cmd_list)
        iter = g_slist_nth(cmd_list, 0);
 
        for (i = 0; i < count; i++) {
+               if (NULL == iter)
+                       break;
+
                temp_cmd = iter->data;
 
                if (NULL == temp_cmd) {
@@ -1689,9 +1692,6 @@ int __vc_cmd_parser_print_commands(GSList* cmd_list)
                         temp_cmd->command, temp_cmd->parameter);
 
                iter = g_slist_next(iter);
-
-               if (NULL == iter)
-                       break;
        }
 
        return 0;