changeset 7761:f4bc6ef7678c

memleaks
author arpi
date Wed, 16 Oct 2002 20:25:23 +0000
parents 5262223af043
children d676c2a86b9e
files libmpdemux/url.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/url.c	Wed Oct 16 20:17:20 2002 +0000
+++ b/libmpdemux/url.c	Wed Oct 16 20:25:23 2002 +0000
@@ -33,6 +33,7 @@
 	Curl->url = strdup(url);
 	if( Curl->url==NULL ) {
 		mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed!\n");
+		free(Curl);
 		return NULL;
 	}
 
@@ -40,6 +41,7 @@
 	ptr1 = strstr(url, "://");
 	if( ptr1==NULL ) {
 		mp_msg(MSGT_NETWORK,MSGL_V,"Not an URL!\n");
+		free(Curl->url);free(Curl);
 		return NULL;
 	}
 	pos1 = ptr1-url;
@@ -47,6 +49,7 @@
 	strncpy(Curl->protocol, url, pos1);
 	if( Curl->protocol==NULL ) {
 		mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed!\n");
+		free(Curl->protocol);free(Curl->url);free(Curl);
 		return NULL;
 	}
 	Curl->protocol[pos1] = '\0';