diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2007-02-26 11:14:53 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2007-02-26 11:14:53 +0000 |
commit | 21a038269e8e2264b149e50355e6e18ccba1d334 (patch) | |
tree | 6e50133395bbfba07de60a23f8da501eeca26c41 /hcid/main.c | |
parent | 695443f8d5e0da5fbff3b44279a0ed6abafdf3bb (diff) |
More glib memory allocation changes
Diffstat (limited to 'hcid/main.c')
-rw-r--r-- | hcid/main.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/hcid/main.c b/hcid/main.c index 01ca2638..be2a72cd 100644 --- a/hcid/main.c +++ b/hcid/main.c @@ -62,7 +62,7 @@ static inline void init_device_defaults(struct device_opts *device_opts) { memset(device_opts, 0, sizeof(*device_opts)); device_opts->scan = SCAN_PAGE; - device_opts->name = strdup("BlueZ"); + device_opts->name = g_strdup("BlueZ"); device_opts->discovto = HCID_DEFAULT_DISCOVERABLE_TIMEOUT; } @@ -91,10 +91,7 @@ static void free_device_opts(void) { struct device_list *device, *next; - if (default_device.name) { - free(default_device.name); - default_device.name = NULL; - } + g_free(default_device.name); for (device = device_list; device; device = next) { g_free(device->ref); @@ -693,7 +690,7 @@ int main(int argc, char *argv[]) break; case 'f': - hcid.config_file = strdup(optarg); + hcid.config_file = g_strdup(optarg); break; default: |