core: fix memory leaks

Since MMModem is an interface and doesn't store stuff like the
modem's physdev internally (since it's an interface) these things
are handled via GObject properties.  And since g_object_get()
returns allocated values, we need to free the returned value
from mm_modem_get_device() after we're done with it.
This commit is contained in:
Dan Williams
2010-05-07 13:56:23 -07:00
parent e855922b4b
commit b8f0f40349
3 changed files with 30 additions and 18 deletions

View File

@@ -150,12 +150,15 @@ disable_disconnect_done (MMModem *self,
}
if (error) {
char *device = mm_modem_get_device (self);
/* Don't really care what the error was; log it and proceed to disable */
g_warning ("%s: (%s): error disconnecting the modem while disabling: (%d) %s",
__func__,
mm_modem_get_device (self),
device,
error ? error->code : -1,
error && error->message ? error->message : "(unknown)");
g_free (device);
}
finish_disable (self, cb_data->callback, cb_data->user_data);
g_free (cb_data);