mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
use calloc so that mp_cmd_free won't use uninitialized data in case of an error
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16072 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
@@ -577,7 +577,7 @@ mp_input_parse_cmd(char* str) {
|
||||
|
||||
cmd_def = &mp_cmds[i];
|
||||
|
||||
cmd = (mp_cmd_t*)malloc(sizeof(mp_cmd_t));
|
||||
cmd = (mp_cmd_t*)calloc(1, sizeof(mp_cmd_t));
|
||||
cmd->id = cmd_def->id;
|
||||
cmd->name = strdup(cmd_def->name);
|
||||
cmd->pausing = pausing;
|
||||
|
||||
Reference in New Issue
Block a user