summaryrefslogtreecommitdiff
path: root/gdata/services
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2015-04-30 21:32:20 +0100
committerPhilip Withnall <philip.withnall@collabora.co.uk>2015-04-30 21:34:15 +0100
commitf21f169ea15fd30cd74b32a0100d6ae96300c53e (patch)
tree2753c2fbab690c096e8eac4d9b759ed6534b717f /gdata/services
parent0f9ff5f12cf65c9a779f87f1e15ffb62c565c295 (diff)
downloadlibgdata-f21f169ea15fd30cd74b32a0100d6ae96300c53e.tar.gz
youtube: Fix freeing static strings in GDataYouTubeVideo
The access control keys are all allocated, not static. This fixes a crash when parsing some videos.
Diffstat (limited to 'gdata/services')
-rw-r--r--gdata/services/youtube/gdata-youtube-video.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdata/services/youtube/gdata-youtube-video.c b/gdata/services/youtube/gdata-youtube-video.c
index dfe37005..204c6a07 100644
--- a/gdata/services/youtube/gdata-youtube-video.c
+++ b/gdata/services/youtube/gdata-youtube-video.c
@@ -98,7 +98,7 @@ struct _GDataYouTubeVideoPrivate {
guint view_count;
guint favorite_count;
gchar *location;
- GHashTable *access_controls;
+ GHashTable/*<owned utf8, GDataYouTubePermission>*/ *access_controls;
/* gd:rating attributes */
struct {
@@ -1166,20 +1166,20 @@ parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GEr
} else if (g_strcmp0 (privacy_status, "public") == 0) {
priv->is_private = FALSE;
g_hash_table_insert (priv->access_controls,
- (gpointer) "list",
+ g_strdup ("list"),
GINT_TO_POINTER (GDATA_YOUTUBE_PERMISSION_ALLOWED));
} else if (g_strcmp0 (privacy_status, "unlisted") == 0) {
/* See: ‘list’ on
* https://developers.google.com/youtube/2.0/reference?csw=1#youtube_data_api_tag_yt:accessControl */
priv->is_private = FALSE;
g_hash_table_insert (priv->access_controls,
- (gpointer) "list",
+ g_strdup ("list"),
GINT_TO_POINTER (GDATA_YOUTUBE_PERMISSION_DENIED));
}
json_reader_read_member (reader, "embeddable");
g_hash_table_insert (priv->access_controls,
- (gpointer) GDATA_YOUTUBE_ACTION_EMBED,
+ g_strdup (GDATA_YOUTUBE_ACTION_EMBED),
GINT_TO_POINTER (json_reader_get_boolean_value (reader) ?
GDATA_YOUTUBE_PERMISSION_ALLOWED :
GDATA_YOUTUBE_PERMISSION_DENIED));