auth: fix memleak and add some docs

Fix a memleak of the basic auth token.
Add docs for the helper function
This commit is contained in:
Wim Taymans 2011-01-12 10:41:42 +01:00
parent c59d9e2970
commit 9f52f281ba

View file

@ -80,6 +80,7 @@ gst_rtsp_auth_finalize (GObject * obj)
GstRTSPAuth *auth = GST_RTSP_AUTH (obj);
GST_INFO ("finalize auth %p", auth);
g_free (auth->basic);
G_OBJECT_CLASS (gst_rtsp_auth_parent_class)->finalize (obj);
}
@ -253,6 +254,16 @@ gst_rtsp_auth_check_method (GstRTSPAuth * auth, GstRTSPMethod method,
return result;
}
/**
* gst_rtsp_auth_make_basic:
* @user: a userid
* @pass: a password
*
* Construct a Basic authorisation token from @user and @pass.
*
* Returns: the base64 encoding of the string @user:@pass. g_free()
* after usage.
*/
gchar *
gst_rtsp_auth_make_basic (const gchar * user, const gchar * pass)
{