[PATCH] ModemManager: Free an allocated string



Just like it says.

    - Nathan
From 97a4b734229a6a9a86f4f819d6c79567c743baaa Mon Sep 17 00:00:00 2001
From: Nathan Williams <njw google com>
Date: Fri, 20 May 2011 14:42:16 -0400
Subject: [PATCH] gsm: free the string allocated by utils_hexstr2bin().

Change-Id: I1f7dabc8209d9757b573a59abb788a2346f72ad5
---
 src/mm-generic-gsm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/mm-generic-gsm.c b/src/mm-generic-gsm.c
index 0a0a3c1..398efc1 100644
--- a/src/mm-generic-gsm.c
+++ b/src/mm-generic-gsm.c
@@ -1801,6 +1801,7 @@ get_mnc_length_done (MMAtSerialPort *port,
                                        MM_MODEM_ERROR_GENERAL,
                                        "SIM returned malformed response '%s'",
                                        hex);
+            g_free (bin);
             goto done;
         }
 
@@ -1815,6 +1816,7 @@ get_mnc_length_done (MMAtSerialPort *port,
                                        "SIM returned invalid MNC length %d (should be either 2 or 3)",
                                        mnc_len);
         }
+        g_free (bin);
     } else {
         info->error = g_error_new (MM_MODEM_ERROR,
                                    MM_MODEM_ERROR_GENERAL,
-- 
1.7.3.1



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]