Add mmt_free() definition

This commit is contained in:
Stefan Rueger
2024-04-20 01:07:26 +01:00
parent 640e9515ea
commit f1105afb47
2 changed files with 2 additions and 1 deletions

View File

@@ -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, ...);

View File

@@ -539,7 +539,7 @@ static int jtagmkII_recv_frame(const PROGRAMMER *pgm, unsigned char **msg,
msglen, MAX_MESSAGE);
state = sSTART;
headeridx = 0;
} else if ((buf = malloc(msglen + 10)) == NULL) {
} else if ((buf = malloc(msglen + 10)) == NULL) { // Sic! malloc is OK here
pmsg_error("out of memory\n");
ignorpkt++;
} else {