Init local variable to avoid crash if loading pkg info failed 29/11129/1 accepted/tizen/20131021.091044 accepted/tizen/20131021.162941 submit/tizen/20131021.084146
authorChengwei Yang <chengwei.yang@intel.com>
Mon, 21 Oct 2013 02:49:40 +0000 (10:49 +0800)
committerChengwei Yang <chengwei.yang@intel.com>
Mon, 21 Oct 2013 02:52:01 +0000 (10:52 +0800)
The uninitialized local variable will cause amd crash (coredump) at
g_hash_table_foreach since the junk pointer in amd.af, this is triggered
by pkg info load failure from pkgmgr.

Change-Id: I1145c11dc88030b40834de769de1443786ca5dda
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
am_daemon/amd_main.c

index 6135d69..75bf298 100755 (executable)
@@ -246,7 +246,10 @@ static void _start_services(struct amdmgr *amd)
 
 static int __init()
 {
-       struct amdmgr amd;
+       struct amdmgr amd = {
+               .af = NULL,
+               .cg = NULL
+       };
 
        ecore_init();
        evas_init();