d->uri was allocated by xstrdup(), so needs to be freed. Was going back
and forth between the below and adding free(d->uri).

Index: rrdp_notification.c
===================================================================
RCS file: /cvs/src/usr.sbin/rpki-client/rrdp_notification.c,v
retrieving revision 1.2
diff -u -p -r1.2 rrdp_notification.c
--- rrdp_notification.c 2 Apr 2021 02:20:17 -0000       1.2
+++ rrdp_notification.c 2 Apr 2021 02:30:37 -0000
@@ -62,6 +62,8 @@ struct notification_xml {
        enum notification_scope  scope;
 };
 
+static void    free_delta(struct delta_item *);
+
 static int
 add_delta(struct notification_xml *nxml, const char *uri,
     const char hash[SHA256_DIGEST_LENGTH], long long serial)
@@ -85,7 +87,7 @@ add_delta(struct notification_xml *nxml,
                TAILQ_FOREACH(n, &nxml->delta_q, q) {
                        if (n->serial == serial) {
                                warnx("duplicate delta serial %lld ", serial);
-                               free(d);
+                               free_delta(d);
                                return 0;
                        }
                        if (n->serial > serial) {

Reply via email to