aboutsummaryrefslogtreecommitdiff
path: root/tecundo.c
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2025-04-13 20:44:02 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2025-04-21 20:49:37 +0300
commit93f61120ddba2093d85dbd09dff2deb42f0393e2 (patch)
tree84daad494628537c5bd2f93ef216029590ed0e01 /tecundo.c
parent278cc757b3146be68376318999415b97220c4d92 (diff)
downloadvideoteco-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.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/tecundo.c b/tecundo.c
index 927cea3..9dd5feb 100644
--- a/tecundo.c
+++ b/tecundo.c
@@ -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;