mirror of
https://github.com/mpv-player/mpv
synced 2025-01-30 03:32:50 +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:
parent
51a7a44449
commit
9fde502c50
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user