[MPlayer-cvslog] r27868 - trunk/stream/http.c

reimar subversion at mplayerhq.hu
Fri Oct 31 13:56:25 CET 2008


Author: reimar
Date: Fri Oct 31 13:56:25 2008
New Revision: 27868

Log:
Avoid a memleak if allocation of field_name fails, fixes bug #1319.


Modified:
   trunk/stream/http.c

Modified: trunk/stream/http.c
==============================================================================
--- trunk/stream/http.c	(original)
+++ trunk/stream/http.c	Fri Oct 31 13:56:25 2008
@@ -550,6 +550,7 @@ http_set_field( HTTP_header_t *http_hdr,
 	new_field->field_name = malloc(strlen(field_name)+1);
 	if( new_field->field_name==NULL ) {
 		mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed\n");
+		free(new_field);
 		return;
 	}
 	strcpy( new_field->field_name, field_name );



More information about the MPlayer-cvslog mailing list