summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-03-22 13:39:40 +0100
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-03-22 13:39:40 +0100
commit43bb87f5fa8fb23aee816636cefeb509397e7291 (patch)
tree3a5272d32307f5b0a593347c3c1e0ffaf49dd7c6 /source4
parent686825e0255a106d7bc67fb6059cd3c1ddefe315 (diff)
downloadsamba-43bb87f5fa8fb23aee816636cefeb509397e7291.tar.gz
samba-43bb87f5fa8fb23aee816636cefeb509397e7291.tar.bz2
samba-43bb87f5fa8fb23aee816636cefeb509397e7291.zip
s4:registry - "patchfile" - check if strings could be allocated
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/registry/patchfile.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/lib/registry/patchfile.c b/source4/lib/registry/patchfile.c
index 9a4c9a6fb7..2932910ea0 100644
--- a/source4/lib/registry/patchfile.c
+++ b/source4/lib/registry/patchfile.c
@@ -95,6 +95,11 @@ WERROR reg_generate_diff_key(struct registry_key *oldkey,
/* if "error2" is going to be "WERR_BADFILE", then newkey */
/* didn't have such a subkey and therefore add a del diff */
tmppath = talloc_asprintf(mem_ctx, "%s\\%s", path, keyname1);
+ if (tmppath == NULL) {
+ DEBUG(0, ("Out of memory\n"));
+ talloc_free(mem_ctx);
+ return WERR_NOMEM;
+ }
if (!W_ERROR_IS_OK(error2))
callbacks->del_key(callback_data, tmppath);
@@ -156,6 +161,11 @@ WERROR reg_generate_diff_key(struct registry_key *oldkey,
/* oldkey didn't have such a subkey, add a add diff */
tmppath = talloc_asprintf(mem_ctx, "%s\\%s", path, keyname1);
+ if (tmppath == NULL) {
+ DEBUG(0, ("Out of memory\n"));
+ talloc_free(mem_ctx);
+ return WERR_NOMEM;
+ }
callbacks->add_key(callback_data, tmppath);
/* perform here also the recursive invocation */