s4:registry/ldb.c - Break with "NULL" as an error case when the data doesn't fit...
[ira/wip.git] / source4 / lib / registry / ldb.c
index 80fbb85ac730679cb79c9f68fd9e0b8c7abfd0d8..2310babd8de1f10c1f71065a451d634d5b1f25b5 100644 (file)
@@ -186,7 +186,8 @@ static struct ldb_message *reg_ldb_pack_value(struct ldb_context *ctx,
                                ret = ldb_msg_add_string(msg, "data", conv_str);
                        } else {
                                /* workaround for non-standard data */
-                               ret = ldb_msg_add_empty(msg, "data", LDB_FLAG_MOD_DELETE, NULL);
+                               talloc_free(msg);
+                               return NULL;
                        }
                } else {
                        ret = ldb_msg_add_empty(msg, "data", LDB_FLAG_MOD_DELETE, NULL);
@@ -207,7 +208,9 @@ static struct ldb_message *reg_ldb_pack_value(struct ldb_context *ctx,
                                ret = ldb_msg_add_string(msg, "data", conv_str);
                        } else {
                                /* workaround for non-standard data */
-                               ret = ldb_msg_add_empty(msg, "data", LDB_FLAG_MOD_DELETE, NULL);
+                               talloc_free(msg);
+                               return NULL;
+
                        }
                } else {
                        ret = ldb_msg_add_empty(msg, "data", LDB_FLAG_MOD_DELETE, NULL);