# HG changeset patch # User arpi # Date 1006821759 0 # Node ID 8dae87740d33a1eb71ebe41733e9bba8953c78a2 # Parent fc5a2369696ebc7f96847b0d5ecfd5196e95d8b5 bad malloc+strcpy => strdup diff -r fc5a2369696e -r 8dae87740d33 libmpdemux/demuxer.c --- a/libmpdemux/demuxer.c Tue Nov 27 00:12:27 2001 +0000 +++ b/libmpdemux/demuxer.c Tue Nov 27 00:42:39 2001 +0000 @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -654,8 +655,7 @@ mp_msg(MSGT_DEMUX, MSGL_WARN, "Demuxer info->name already present\n!"); return(0); } - info->name = malloc(strlen(param)); - strcpy(info->name, param); + info->name = strdup(param); return(1); } @@ -666,8 +666,7 @@ mp_msg(MSGT_DEMUX, MSGL_WARN, "Demuxer info->author already present\n!"); return(0); } - info->author = malloc(strlen(param)); - strcpy(info->author, param); + info->author = strdup(param); return(1); } @@ -678,8 +677,7 @@ mp_msg(MSGT_DEMUX, MSGL_WARN, "Demuxer info->encoder already present\n!"); return(0); } - info->encoder = malloc(strlen(param)); - strcpy(info->encoder, param); + info->encoder = strdup(param); return(1); } @@ -690,8 +688,7 @@ mp_msg(MSGT_DEMUX, MSGL_WARN, "Demuxer info->comments already present\n!"); return(0); } - info->comments = malloc(strlen(param)); - strcpy(info->comments, param); + info->comments = strdup(param); return(1); } @@ -702,8 +699,7 @@ mp_msg(MSGT_DEMUX, MSGL_WARN, "Demuxer info->copyright already present\n!"); return(0); } - info->copyright = malloc(strlen(param)); - strcpy(info->copyright, param); + info->copyright = strdup(param); return(1); }