From d3c0b705eb74d4f33d8232ae6e67c842ea54bd30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 12 Dec 2006 16:10:21 +0000 Subject: ext/neon/gstneonhttpsrc.c: Fix minor mem leak in redirect code. Original commit message from CVS: * ext/neon/gstneonhttpsrc.c: (gst_neonhttp_src_create), (send_request_and_redirect): Fix minor mem leak in redirect code. * tests/check/Makefile.am: * tests/check/elements/.cvsignore: * tests/check/elements/neonhttpsrc.c: (handoff_cb), (GST_START_TEST), (neonhttpsrc_suite): * tests/check/gst-plugins-bad.supp: Add super-basic unit test for #384140. --- ext/neon/gstneonhttpsrc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ext/neon') diff --git a/ext/neon/gstneonhttpsrc.c b/ext/neon/gstneonhttpsrc.c index 5c747139..5777dbb4 100644 --- a/ext/neon/gstneonhttpsrc.c +++ b/ext/neon/gstneonhttpsrc.c @@ -344,6 +344,8 @@ gst_neonhttp_src_create (GstPushSrc * psrc, GstBuffer ** outbuf) if (G_UNLIKELY (read < 0)) goto read_error; + GST_LOG_OBJECT (src, "returning %u bytes", GST_BUFFER_SIZE (*outbuf)); + done: return ret; @@ -411,8 +413,6 @@ send_request_and_redirect (GstNeonhttpSrc * src, gboolean do_redir) gint res; gint http_status = 0; - const gchar *redir = g_strdup (""); - guint request_count = 0; #ifndef GST_DISABLE_GST_DEBUG @@ -454,6 +454,8 @@ send_request_and_redirect (GstNeonhttpSrc * src, gboolean do_redir) * Reload the HTTP request with a new URI value */ http_status = ne_get_status (src->request)->code; if (http_status == 302) { + const gchar *redir; + /* the new URI value to go when redirecting can be found on the 'Location' HTTP header */ redir = ne_get_response_header (src->request, "Location"); if (redir != NULL) { -- cgit v1.2.1