[PATCH 1/2] wavecom: fix memory leak

Ben Chan benchan at chromium.org
Sat Oct 7 01:05:35 UTC 2017


---
 plugins/wavecom/mm-broadband-modem-wavecom.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/plugins/wavecom/mm-broadband-modem-wavecom.c b/plugins/wavecom/mm-broadband-modem-wavecom.c
index 94115408..5da6c232 100644
--- a/plugins/wavecom/mm-broadband-modem-wavecom.c
+++ b/plugins/wavecom/mm-broadband-modem-wavecom.c
@@ -305,13 +305,14 @@ wwsm_read_ready (MMBaseModem  *self,
         }
     }
 
-    if (result->allowed == MM_MODEM_MODE_NONE)
+    if (result->allowed == MM_MODEM_MODE_NONE) {
         g_task_return_new_error (task,
                                  MM_CORE_ERROR,
                                  MM_CORE_ERROR_FAILED,
                                  "Unknown wireless data service reply: '%s'",
                                  response);
-    else
+        g_free (result);
+    } else
         g_task_return_pointer (task, result, g_free);
     g_object_unref (task);
 
-- 
2.14.2.920.gcf0c67979c-goog



More information about the ModemManager-devel mailing list