changeset 12637:5dc89722fad2

uber 10l found by Ilia <chest4l at mail.ru>
author alex
date Fri, 25 Jun 2004 14:57:01 +0000
parents 58dca847caa0
children 2ebd553876c8
files libmpdemux/url.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/url.c	Fri Jun 25 14:52:04 2004 +0000
+++ b/libmpdemux/url.c	Fri Jun 25 14:57:01 2004 +0000
@@ -79,12 +79,12 @@
 	}
 	pos1 = ptr1-escfilename;
 	Curl->protocol = (char*)malloc(pos1+1);
-	strncpy(Curl->protocol, escfilename, pos1);
 	if( Curl->protocol==NULL ) {
 		mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed!\n");
 		url_free(Curl);
 		return NULL;
 	}
+	strncpy(Curl->protocol, escfilename, pos1);
 	Curl->protocol[pos1] = '\0';
 
 	// jump the "://"