]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/modify.c
Fix double-free on ciphersuite parse failure
[openldap] / libraries / libldap / modify.c
index 45ccfbc98a3cc30cae66ab57197fbc76a30a9fd9..d598064dc63190f05ca5a34a9360279315a8957b 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2006 The OpenLDAP Foundation.
+ * Copyright 1998-2014 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -201,7 +201,7 @@ ldap_modify_ext_s( LDAP *ld, LDAP_CONST char *dn,
        if ( rc != LDAP_SUCCESS )
                return( rc );
 
-       if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 )
+       if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 || !res )
                return( ld->ld_errno );
 
        return( ldap_result2error( ld, res, 1 ) );