[WGID-258402] Add null check after malloc() 69/150969/1 accepted/tizen/unified/20170921.072225 submit/tizen/20170920.020838
authorchleun.moon <chleun.moon@samsung.com>
Tue, 19 Sep 2017 08:01:31 +0000 (17:01 +0900)
committerchleun.moon <chleun.moon@samsung.com>
Tue, 19 Sep 2017 08:01:35 +0000 (17:01 +0900)
Change-Id: If086843b52a4621383d5f2999b671072fb8aad81
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
packaging/capi-network-asp.spec
test/asp-test.c

index e83625c..3e2fb36 100755 (executable)
@@ -2,7 +2,7 @@
 
 Name:       capi-network-asp
 Summary:    An Application Service Platform(ASP) libraries in Native API
-Version:    0.0.12
+Version:    0.0.13
 Release:    1
 Group:      Network & Connectivity/API
 License:    Apache-2.0
index e0f5cfb..8c5f560 100644 (file)
@@ -1855,7 +1855,10 @@ int main(int argc, char **argv)
        main_loop = g_main_loop_new(NULL, FALSE);
 
        ad = (struct appdata*)malloc(sizeof(struct appdata));
-
+       if (!ad) {
+               printf("Error: malloc()\n");
+               return -1;
+       }
 
        set_appdata(ad);
        ad->main_loop = main_loop;