From: chleun.moon Date: Tue, 19 Sep 2017 08:01:31 +0000 (+0900) Subject: [WGID-258402] Add null check after malloc() X-Git-Tag: submit/tizen/20170920.020838^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F69%2F150969%2F1;p=platform%2Fcore%2Fapi%2Fasp.git [WGID-258402] Add null check after malloc() Change-Id: If086843b52a4621383d5f2999b671072fb8aad81 Signed-off-by: Cheoleun Moon --- diff --git a/packaging/capi-network-asp.spec b/packaging/capi-network-asp.spec index e83625c..3e2fb36 100755 --- a/packaging/capi-network-asp.spec +++ b/packaging/capi-network-asp.spec @@ -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 diff --git a/test/asp-test.c b/test/asp-test.c index e0f5cfb..8c5f560 100644 --- a/test/asp-test.c +++ b/test/asp-test.c @@ -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;