Quote from the report:
Affected code
src/engine-gpg.c, functions read_status() and read_colon_line(). Confirmed present up to current master (also in 1.18.0 and later releases shipped in distributions).
Root cause
Both functions take a local copy of the engine's status/colon buffer pointer, grow it with realloc(), and only write the new pointer back to the engine object at the very end of the function:
char *buffer = gpg->status.buffer; /* local copy */ ... buffer = realloc (buffer, bufsize); /* may move + free old block */ if (!buffer) return gpg_error_from_syserror (); ... gpg->status.buffer = buffer; /* write-back only on success */
realloc() may move the block, freeing the old one. Between the realloc and that final write-back there are several early return paths, for example when a status callback (gpg->status.fnc / mon_cb) or the colon preprocess callback returns an error. On those paths the engine's buffer field is left pointing at the already-freed old block; the newly reallocated block leaks, and the stale pointer is freed a second time when the engine is released. That is the double free.
CVE-id: CVE-2026-129975