Add new script for building IDL files in librpc/idl, generating both
[sfrench/samba-autobuild/.git] / source4 / lib / ldb / ldb_wrap.c
index 194b562c3023334eda1ebd74eb0167774ff352fe..e290b851f381916a2c4f7757418aa8d543a73d02 100644 (file)
@@ -2684,7 +2684,7 @@ SWIGINTERN ldb_dn *new_ldb_dn(ldb *ldb_ctx,char const *str){
                we do it this way... */
             talloc_steal(NULL, ret);
 
-            if (ret == NULL)
+            if (ret == NULL || !ldb_dn_validate(ret))
                 SWIG_exception(SWIG_ValueError, 
                                 "unable to parse dn string");
 fail:
@@ -2732,7 +2732,6 @@ SWIGINTERN char const *ldb_dn_canonical_ex_str(ldb_dn *self){
 SWIGINTERN char *ldb_dn___repr__(ldb_dn *self){
             char *dn = ldb_dn_get_linearized(self), *ret;
             asprintf(&ret, "Dn('%s')", dn);
-            talloc_free(dn);
             return ret;
         }
 SWIGINTERN ldb_dn *ldb_dn___add__(ldb_dn *self,ldb_dn *other){