diff options
author | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2011-08-11 16:56:18 +0200 |
---|---|---|
committer | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2011-08-11 17:40:52 +0200 |
commit | 608a2e066d349b4b433b5edc975a3fc9202589e1 (patch) | |
tree | 0085b1b192f9968a171984a4a824938d1b32c7ae | |
parent | f6a83bfa70bd6a6f4f442462caabf8ac017ac34f (diff) | |
download | connman-608a2e066d349b4b433b5edc975a3fc9202589e1.tar.gz connman-608a2e066d349b4b433b5edc975a3fc9202589e1.tar.bz2 connman-608a2e066d349b4b433b5edc975a3fc9202589e1.zip |
session: Free ifname
connman_inet_ifname() returns strdup() string.
-rw-r--r-- | src/session.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/session.c b/src/session.c index f17e284b..f6b9b51a 100644 --- a/src/session.c +++ b/src/session.c @@ -67,7 +67,7 @@ struct service_entry { enum connman_service_state state; const char *name; struct connman_service *service; - const char *ifname; + char *ifname; const char *bearer; }; @@ -1004,7 +1004,7 @@ static struct service_entry *create_service_entry(struct connman_service *servic idx = __connman_service_get_index(entry->service); entry->ifname = connman_inet_ifname(idx); if (entry->ifname == NULL) - entry->ifname = ""; + entry->ifname = g_strdup(""); type = connman_service_get_type(entry->service); entry->bearer = service2bearer(type); @@ -1016,6 +1016,8 @@ static void destroy_service_entry(gpointer data) { struct service_entry *entry = data; + g_free(entry->ifname); + g_free(entry); } |