aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/qreg-commands.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2025-03-19 12:32:10 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2025-03-19 12:32:10 +0300
commit257a0bf128e109442dce91c4aaa1d97fed17ad1a (patch)
tree8880d3e260d6f18e7d9c7935b7886807db510fe3 /src/qreg-commands.h
parent2b92178287efe3b53237e9d61c69a4bf350c716d (diff)
downloadsciteco-257a0bf128e109442dce91c4aaa1d97fed17ad1a.tar.gz
fixed leaking data on rubout
* Objects, that are restored with TECO_DEFINE_UNDO_OBJECT_OWN(), could actually leak memory on rubout since the old object was not deleted when overwriting it. * Now that it is, it is crucial to at least nullify objects/pointers after calling the corresponding push-function. These conditions are now explicitly documented. * The test suite now runs successfully under Valgrind even with full leak checking.
Diffstat (limited to 'src/qreg-commands.h')
-rw-r--r--src/qreg-commands.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qreg-commands.h b/src/qreg-commands.h
index 6dbd1c4..f6ad82a 100644
--- a/src/qreg-commands.h
+++ b/src/qreg-commands.h
@@ -30,6 +30,7 @@ teco_state_expectqreg_reset(teco_machine_main_t *ctx)
teco_undo_qregspec_own(ctx->expectqreg);
else
teco_machine_qregspec_free(ctx->expectqreg);
+ ctx->expectqreg = NULL;
}
gboolean teco_state_expectqreg_initial(teco_machine_main_t *ctx, GError **error);