diff options
| author | Michael Biebl <biebl@debian.org> | 2016-05-11 17:08:25 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2016-05-11 17:08:25 +0200 |
| commit | 73e152af6e3fb4f5848bfb8394484026ff119003 (patch) | |
| tree | d5a8b37778d3a95c51511451b38b6a329b94cb41 /src/settings/plugins | |
| parent | 78c3b8801ecf4975e5da1af3b10ae20dd2d876de (diff) | |
Imported Upstream version 1.2.2 upstream/1.2.2
Diffstat (limited to 'src/settings/plugins')
| -rw-r--r-- | src/settings/plugins/ifnet/connection_parser.c | 11 | ||||
| -rw-r--r-- | src/settings/plugins/ifupdown/interface_parser.c | 16 |
2 files changed, 12 insertions, 15 deletions
diff --git a/src/settings/plugins/ifnet/connection_parser.c b/src/settings/plugins/ifnet/connection_parser.c index d9ff97dc..80b82535 100644 --- a/src/settings/plugins/ifnet/connection_parser.c +++ b/src/settings/plugins/ifnet/connection_parser.c @@ -1541,15 +1541,12 @@ make_wireless_security_setting (const char *conn_name, if (wsec == NULL) goto error; } - - if (!wsec) { - g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION, - "Can't handle security information for ssid: %s", - conn_name); - } - return wsec; + error: + g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION, + "Can't handle security information for ssid: %s", + conn_name); return NULL; } diff --git a/src/settings/plugins/ifupdown/interface_parser.c b/src/settings/plugins/ifupdown/interface_parser.c index d342501b..7ad902d4 100644 --- a/src/settings/plugins/ifupdown/interface_parser.c +++ b/src/settings/plugins/ifupdown/interface_parser.c @@ -39,7 +39,7 @@ if_data* last_data; void add_block(const char *type, const char* name) { - if_block *ret = (if_block*)calloc(1,sizeof(struct _if_block)); + if_block *ret = g_slice_new0 (struct _if_block); ret->name = g_strdup(name); ret->type = g_strdup(type); if (first == NULL) @@ -61,7 +61,7 @@ void add_data(const char *key,const char *data) if (first == NULL) return; - ret = (if_data*) calloc(1,sizeof(struct _if_data)); + ret = g_slice_new0 (struct _if_data); ret->key = g_strdup(key); /* Normalize keys. Convert '_' to '-', as ifupdown accepts both variants. @@ -298,9 +298,9 @@ void _destroy_data(if_data *ifd) if (ifd == NULL) return; _destroy_data(ifd->next); - free(ifd->key); - free(ifd->data); - free(ifd); + g_free(ifd->key); + g_free(ifd->data); + g_slice_free(struct _if_data, ifd); return; } @@ -310,9 +310,9 @@ void _destroy_block(if_block* ifb) return; _destroy_block(ifb->next); _destroy_data(ifb->info); - free(ifb->name); - free(ifb->type); - free(ifb); + g_free(ifb->name); + g_free(ifb->type); + g_slice_free(struct _if_block, ifb); return; } |