From 4abb4797613868e518baafb5f3618e78f67ac05c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 28 Sep 2005 19:56:21 +0000 Subject: r10588: Remove more unused files, macros (This used to be commit d2f80c0457f7404b2cac9df59a400130e9ad025f) --- source4/lib/registry/tools/regpatch.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'source4/lib/registry/tools/regpatch.c') diff --git a/source4/lib/registry/tools/regpatch.c b/source4/lib/registry/tools/regpatch.c index 887f53df37..98e6c0ff5d 100644 --- a/source4/lib/registry/tools/regpatch.c +++ b/source4/lib/registry/tools/regpatch.c @@ -156,10 +156,13 @@ static void print_line(struct cmd_line *cl) */ static struct cmd_line *get_cmd_line(int fd) { - CMD_LINE *cl = smb_xmalloc_p(CMD_LINE); + CMD_LINE *cl = malloc_p(CMD_LINE); int i = 0, rc; uint8_t ch; + if (!cl) + return NULL; + cl->len = INIT_ALLOC; /* @@ -447,7 +450,9 @@ static CMD *regedit4_get_cmd(int fd) struct cmd_line *cl = NULL; struct val_spec_list *vl = NULL; - cmd = smb_xmalloc_p(struct command_s); + cmd = malloc_p(struct command_s); + if (!cmd) + return NULL; cmd->cmd = CMD_NONE; cmd->key = NULL; @@ -490,7 +495,9 @@ static CMD *regedit4_get_cmd(int fd) * There could be a \ on the end which we need to * handle at some time */ - vl = smb_xmalloc_p(struct val_spec_list); + vl = malloc_p(struct val_spec_list); + if (!vl) + return NULL; vl->next = NULL; vl->val = NULL; vl->name = parse_value(cl, &vl->type, &vl->val); @@ -609,7 +616,9 @@ static CMD_FILE *cmd_file_create(const char *file) return NULL; } - tmp = smb_xmalloc_p(CMD_FILE); + tmp = malloc_p(CMD_FILE); + if (!tmp) + return NULL; /* * Let's fill in some of the fields; -- cgit