]> git.sur5r.net Git - openldap/blobdiff - libraries/librewrite/subst.c
Merge remote branch 'origin/mdb.master'
[openldap] / libraries / librewrite / subst.c
index dde7d346238315353c07943b930212279116438f..5b01a1012421aa17c187bfcc62dd02c79c78a9a4 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2000-2007 The OpenLDAP Foundation.
+ * Copyright 2000-2011 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -193,6 +193,10 @@ rewrite_subst_compile(
                subs_len += l;
                subs[ nsub ].bv_len = l;
                subs[ nsub ].bv_val = malloc( l + 1 );
+               if ( subs[ nsub ].bv_val == NULL ) {
+                       free( subs );
+                       goto cleanup;
+               }
                AC_MEMCPY( subs[ nsub ].bv_val, begin, l );
                subs[ nsub ].bv_val[ l ] = '\0';
        } else {