From 36d16fd21b3649ffef4bbd5fd32207b6670ead8c Mon Sep 17 00:00:00 2001 From: leitner Date: Fri, 21 Apr 2017 16:37:31 +0000 Subject: [PATCH] fix a memory leak --- ldif_parse.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ldif_parse.c b/ldif_parse.c index 10b74c2..d59daea 100644 --- a/ldif_parse.c +++ b/ldif_parse.c @@ -323,7 +323,10 @@ lookagain: buffer_putsflush(buffer_2,": error: parse error (maybe 2nd empty line?)\n"); exit(1); } - if ((*l)->dn==(uint32_t)-1) return 0; + if ((*l)->dn==(uint32_t)-1) { + stralloc_free(&payload); + return 0; + } if (ldif_parse_callback && ldif_parse_callback(*l)==-1) return -1; if ((*l)->dn==(uint32_t)-1 && ((*l)->next)) { struct ldaprec* m=(*l)->next;