From 7732236996d5185a0f62ef35ac6d7d9abad6c70b Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Fri, 19 Aug 2005 15:05:03 +0000 Subject: [PATCH] plug yet another one-time leak --- libraries/libldap/schema.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/libldap/schema.c b/libraries/libldap/schema.c index 182fe94c9c..bff6c5bdbe 100644 --- a/libraries/libldap/schema.c +++ b/libraries/libldap/schema.c @@ -1250,11 +1250,11 @@ parse_noidlen(const char **sp, int *code, int *len, int flags) && *sp == savepos && *code == LDAP_SCHERR_NODIGIT ) { - if ( get_token(sp, &sval) == TK_BAREWORD ) { - int len = *sp - savepos; - sval = LDAP_MALLOC(len+1); - strncpy(sval, savepos, len); - sval[len] = '\0'; + if ( get_token(sp, &sval) != TK_BAREWORD ) { + if ( sval != NULL ) { + LDAP_FREE(sval); + } + return NULL; } } else { return NULL; -- 2.39.5