diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2010-10-01 16:49:10 +0100 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2010-10-01 17:03:41 +0100 |
commit | e57ff90723280f82018fa649c5bc03a43d7d43bb (patch) | |
tree | 835fe355732b716d40bab29ab63719967f57b97e | |
parent | 6f64e147313122a03c2f7a18e22218ae8e038490 (diff) | |
download | telepathy-gabble-e57ff90723280f82018fa649c5bc03a43d7d43bb.tar.gz |
Always slice-allocate GabbleDiscoIdentity
gabble_disco_identity_new() returns slice-allocated GabbleDiscoIdentitys;
gabble_disco_identity_free() slice-frees its argument. So we need to
slice-allocate them when we copy them, too.
-rw-r--r-- | src/util.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/util.c b/src/util.c index b326ac19a..f475c6546 100644 --- a/src/util.c +++ b/src/util.c @@ -1313,13 +1313,10 @@ gabble_disco_identity_new (const gchar *category, GabbleDiscoIdentity * gabble_disco_identity_copy (const GabbleDiscoIdentity *source) { - GabbleDiscoIdentity *ret = g_new (GabbleDiscoIdentity, 1); + g_return_val_if_fail (source != NULL, NULL); - ret->category = g_strdup (source->category); - ret->type = g_strdup (source->type); - ret->lang = g_strdup (source->lang); - ret->name = g_strdup (source->name); - return ret; + return gabble_disco_identity_new (source->category, source->type, + source->lang, source->name); } const gchar * |