[Mplayer-cvslog] CVS: main/libmpdemux url.c,1.16,1.17
Arpi of Ize
arpi at mplayerhq.hu
Wed Oct 16 22:25:26 CEST 2002
Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv6455
Modified Files:
url.c
Log Message:
memleaks
Index: url.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/url.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- url.c 9 Sep 2002 04:16:16 -0000 1.16
+++ url.c 16 Oct 2002 20:25:23 -0000 1.17
@@ -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';
More information about the MPlayer-cvslog
mailing list