Skip to content

Commit

Permalink
config: Memory leak in connman_config_provision_mutable_service
Browse files Browse the repository at this point in the history
The value returned by g_key_file_get_start_group has to be
deallocated by the caller.
  • Loading branch information
monich authored and igaw committed Apr 24, 2017
1 parent 8087a3e commit b92e8ff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1559,7 +1559,7 @@ int connman_config_provision_mutable_service(GKeyFile *keyfile)
{
struct connman_config_service *service_config;
struct connman_config *config;
char *vfile, *group;
char *vfile, *group = NULL;
char rstr[11];

DBG("");
Expand Down Expand Up @@ -1595,13 +1595,14 @@ int connman_config_provision_mutable_service(GKeyFile *keyfile)
if (g_strcmp0(service_config->type, "wifi") == 0)
__connman_device_request_scan(CONNMAN_SERVICE_TYPE_WIFI);

g_free(group);
return 0;

error:
DBG("Could not proceed");
g_hash_table_remove(config_table, vfile);
g_free(vfile);

g_free(group);
return -EINVAL;
}

Expand Down

0 comments on commit b92e8ff

Please sign in to comment.