From 365f6bf69b32898e8372a32936fbfd2b8be9068f Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 3 Feb 1999 05:51:42 +0000 Subject: [PATCH] Fix double free of filter when bad. --- servers/slapd/filter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/servers/slapd/filter.c b/servers/slapd/filter.c index 5f4c686571..dff90b0446 100644 --- a/servers/slapd/filter.c +++ b/servers/slapd/filter.c @@ -47,7 +47,6 @@ get_filter( Connection *conn, BerElement *ber, Filter **filt, char **fstr ) */ f = (Filter *) ch_malloc( sizeof(Filter) ); - *filt = f; f->f_next = NULL; err = 0; @@ -175,6 +174,8 @@ get_filter( Connection *conn, BerElement *ber, Filter **filt, char **fstr ) if ( *fstr != NULL ) { free( *fstr ); } + } else { + *filt = f; } Debug( LDAP_DEBUG_FILTER, "end get_filter %d\n", err, 0, 0 ); -- 2.39.5