diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-04-13 20:44:02 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-04-21 20:49:37 +0300 |
commit | 93f61120ddba2093d85dbd09dff2deb42f0393e2 (patch) | |
tree | 84daad494628537c5bd2f93ef216029590ed0e01 /tecundo.c | |
parent | 278cc757b3146be68376318999415b97220c4d92 (diff) | |
download | videoteco-fork-93f61120ddba2093d85dbd09dff2deb42f0393e2.tar.gz |
properly initialize all allocated structures
* Fixes access to uninitialized field in cmd_token, as found via Valgrind.
* Possibly other structures also aren't fully initialized, so I memset()
them as well.
Diffstat (limited to 'tecundo.c')
-rw-r--r-- | tecundo.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -368,11 +368,7 @@ register struct undo_token *ut; ut = (struct undo_token *)tec_alloc(TYPE_C_UNDO,sizeof(struct undo_token)); if(ut == NULL) return(NULL); - ut->opcode = UNDO_C_UNUSED; - ut->iarg1 = 0; - ut->iarg2 = 0; - ut->carg1 = NULL; - ut->next_token = NULL; + memset(ut,0,sizeof(*ut)); if(ct != NULL){ ut->next_token = ct->undo_list; |