r24725: Don't segfault if hive file can't be found
authorJelmer Vernooij <jelmer@samba.org>
Mon, 27 Aug 2007 21:24:44 +0000 (21:24 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 20:02:57 +0000 (15:02 -0500)
source/lib/registry/tools/regshell.c

index 0887bc91f3d0304f3147a34d0c6ae1bc62ecab3d..131d76fff5ccf2bd74f0d0482bb4854d1a3b4c6e 100644 (file)
@@ -481,6 +481,8 @@ int main(int argc, char **argv)
                ctx->registry = reg_common_open_remote(remote, cmdline_credentials);
        } else if (file != NULL) {
                ctx->current = reg_common_open_file(file, cmdline_credentials);
+               if (ctx->current == NULL)
+                       return 1;
                ctx->registry = ctx->current->context;
                ctx->path = talloc_strdup(ctx, "");
        } else {