]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/tls_m.c
ITS#7871 fix ldif-wrap length
[openldap] / libraries / libldap / tls_m.c
index 36dc989ef0c42fd84f226a6194e8ec2b10a5ccae..c1d0c2eefe4384aa03cf437ecdead3e3ed235cf9 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2008-2013 The OpenLDAP Foundation.
+ * Copyright 2008-2014 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -2066,8 +2066,10 @@ tlsm_ctx_free ( tls_ctx *ctx )
                                   errcode, PR_ErrorToString( errcode, PR_LANGUAGE_I_DEFAULT ), 0 );
                }
        }
-       PL_strfree( c->tc_pin_file );
-       c->tc_pin_file = NULL;
+       if ( c->tc_pin_file ) {
+               PL_strfree( c->tc_pin_file );
+               c->tc_pin_file = NULL;
+       }
        tlsm_free_pem_objs( c );
 #ifdef HAVE_NSS_INITCONTEXT
        if ( c->tc_initctx ) {
@@ -2317,7 +2319,8 @@ tlsm_deferred_ctx_init( void *arg )
                                return rc;
                        }
                } else {
-                       PL_strfree( ctx->tc_pin_file );
+                       if ( ctx->tc_pin_file )
+                               PL_strfree( ctx->tc_pin_file );
                        ctx->tc_pin_file = PL_strdup( lt->lt_keyfile );
                }
        }