[Title] fix the Resource leak
authorSooyoung Ha <yoosah.ha@samsung.com>
Thu, 10 Jan 2013 09:23:57 +0000 (18:23 +0900)
committerSooyoung Ha <yoosah.ha@samsung.com>
Thu, 10 Jan 2013 09:29:47 +0000 (18:29 +0900)
[Desc.] modify vmodem/at/at_func.c, at_msg.c

vmodem/at/at_func.c
vmodem/at/at_msg.c
vmodem/db/db_network.c

index 88d8adb091f5669b22e4ff01b5dfedfc3b7ab6ba..63e55fed152f8eb8f5fcfe0d4653dadd42ed6ed7 100644 (file)
@@ -7,7 +7,6 @@
  * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
  * HyunGoo Kang <hyungoo1.kang@samsung.com>
  * 
  * This program is free software; you can redistribute it and/or
@@ -374,17 +373,13 @@ uint8_t hexCharToInt(char c)
 
 int hexStringToBytes(char* d, char * s)
 {
-    char* ret;
     int i;
     int sz;
 
-    if(s == NULL)
+    if(s == NULL || d == NULL)
         return 0;
 
-       sz = strlen(s);
-
-    ret = malloc(sz /2);
-
+    sz = strlen(s);
 
     for(i = 0; i < sz; i += 2)
     {
index 1a79a79feabe7b36fa8432844d535894a7031669..3c713f605e815b1c16f10d2a86c606a4e58d00f5 100644 (file)
@@ -127,10 +127,12 @@ void ATFreeAllMultiNodeList(void)
 void ATPushHDLCMultiFrameInfo(HDLCFrame_t const* pframe)
 {
        TRACE(MSGL_VGSM_INFO, "\n");
+       if (!pframe)
+               return;
 
        HDLCNode* pnode = malloc(sizeof(HDLCNode));
 
-       if (!pframe)
+       if (!pnode)
                return;
 
        memset(pnode, 0, sizeof(HDLCNode));
index 74a98acf88a3e3be95fcee1750b38fdd991053ac..357ee1afeb978160632aaa79f2ded8504317dfcb 100644 (file)
@@ -7,7 +7,6 @@
  * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
  * HyunGoo Kang <hyungoo1.kang@samsung.com>
  * 
  * This program is free software; you can redistribute it and/or