mirror of
https://github.com/mpv-player/mpv
synced 2025-02-17 04:58:06 +00:00
Avoid a memleak if allocation of field_name fails, fixes bug #1319.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27868 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
e5d8522407
commit
d4020af479
@ -550,6 +550,7 @@ http_set_field( HTTP_header_t *http_hdr, const char *field_name ) {
|
||||
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 );
|
||||
|
Loading…
Reference in New Issue
Block a user