From 345e4a985c150559e7d052394a1fc3602e2d03dc Mon Sep 17 00:00:00 2001 From: Stefan Rueger Date: Fri, 19 Apr 2024 12:24:37 +0100 Subject: [PATCH] Utilise magic memory tree interface for dryrun.c --- src/avrdude.h | 1 + src/dryrun.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/avrdude.h b/src/avrdude.h index c679a6546..6b777d30a 100644 --- a/src/avrdude.h +++ b/src/avrdude.h @@ -44,6 +44,7 @@ extern const char *pgmid; // Programmer -c string #define mmt_strdup(s) cfg_strdup(__func__, s) #define mmt_malloc(n) cfg_malloc(__func__, n) #define mmt_realloc(p, n) cfg_realloc(__func__, p, n) +#define mmt_free(p) free(p) int avrdude_message2(FILE *fp, int lno, const char *file, const char *func, int msgmode, int msglvl, const char *format, ...); diff --git a/src/dryrun.c b/src/dryrun.c index bb4f821cc..04da53d09 100644 --- a/src/dryrun.c +++ b/src/dryrun.c @@ -535,13 +535,13 @@ static int dryrun_readonly(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM static void dryrun_setup(PROGRAMMER *pgm) { pmsg_debug("%s()\n", __func__); // Allocate dry - pgm->cookie = cfg_malloc(__func__, sizeof(dryrun_t)); + pgm->cookie = mmt_malloc(sizeof(dryrun_t)); } static void dryrun_teardown(PROGRAMMER *pgm) { pmsg_debug("%s()\n", __func__); - free(pgm->cookie); + mmt_free(pgm->cookie); pgm->cookie = NULL; }