]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
Free line memory even if zone file parsing fails
authorClaudius Zingerli <gitmail@zeuz.ch>
Tue, 21 Jun 2022 14:58:29 +0000 (16:58 +0200)
committerClaudius Zingerli <gitmail@zeuz.ch>
Tue, 21 Jun 2022 14:58:29 +0000 (16:58 +0200)
rr.c

diff --git a/rr.c b/rr.c
index eb24f3c9e79b1354192e6348bae3d8c342b2f006..d12e5b16d784c00ec3387414d63aaaf80f768fd7 100644 (file)
--- a/rr.c
+++ b/rr.c
@@ -742,6 +742,7 @@ _ldns_rr_new_frm_fp_l_internal(ldns_rr **newrr, FILE *fp,
        /* read an entire line in from the file */
        if ((s = ldns_fget_token_l_st( fp, &line, &limit, false
                                     , LDNS_PARSE_SKIP_SPACE, line_nr)))
+               LDNS_FREE(line);
                return s;
 
        if (strncmp(line, "$ORIGIN", 7) == 0 && isspace((unsigned char)line[7])) {