Apply Tizen 3.0 TV Svace 15 checkers 80/55780/1 accepted/tizen/mobile/20151229.115908 accepted/tizen/tv/20151229.115926 accepted/tizen/wearable/20151229.115938 submit/tizen/20151229.083122
authorJihoon Jung <jh8801.jung@samsung.com>
Tue, 29 Dec 2015 08:18:21 +0000 (17:18 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Tue, 29 Dec 2015 08:18:55 +0000 (17:18 +0900)
Signed-off-by: Ji-hoon Jung <jh8801.jung@samsung.com>
Change-Id: Ie7d47a4a9c4b5d04596519bc884f6003b8e3cfcc

src/manager/net_nfc_server_tag.c

index 19f6e73..30fc10d 100755 (executable)
@@ -289,6 +289,9 @@ static data_s *_get_barcode_from_target_info(net_nfc_current_target_info_s *targ
                pos++;
 
                str = g_new0(gchar, length + 1);
+               if(str == NULL)
+                       return NULL;
+
                memcpy(str, pos, length);
 
                DEBUG_CLIENT_MSG("key = [%s]", str);
@@ -302,7 +305,10 @@ static data_s *_get_barcode_from_target_info(net_nfc_current_target_info_s *targ
                {
                        data = (data_s *)calloc(1, sizeof(data_s));
                        if(data == NULL)
+                       {
+                               g_free(str);
                                return NULL;
+                       }
 
                        data->length = length;
 
@@ -310,6 +316,7 @@ static data_s *_get_barcode_from_target_info(net_nfc_current_target_info_s *targ
                        if(data->buffer == NULL)
                        {
                                free(data);
+                               g_free(str);
                                return NULL;
                        }
 
@@ -318,6 +325,9 @@ static data_s *_get_barcode_from_target_info(net_nfc_current_target_info_s *targ
                        break;
                }
 
+               g_free(str);
+               str = NULL;
+
                pos += length;
                i++;
        }