Free s->last_mod before overwriting it with a new last_mod.
authortb <tb@openbsd.org>
Thu, 10 Feb 2022 11:11:22 +0000 (11:11 +0000)
committertb <tb@openbsd.org>
Thu, 10 Feb 2022 11:11:22 +0000 (11:11 +0000)
ok claudio

usr.sbin/rpki-client/rrdp.c

index 4d39421..8a4e8cb 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: rrdp.c,v 1.21 2022/01/23 12:09:24 claudio Exp $ */
+/*     $OpenBSD: rrdp.c,v 1.22 2022/02/10 11:11:22 tb Exp $ */
 /*
  * Copyright (c) 2020 Nils Fisher <nils_fisher@hotmail.com>
  * Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
@@ -429,6 +429,7 @@ rrdp_input_handler(int fd)
                        errx(1, "%s: bad internal state", s->local);
 
                s->res = res;
+               free(s->last_mod);
                s->last_mod = last_mod;
                s->state |= RRDP_STATE_HTTP_DONE;
                rrdp_finished(s);