flags);
if (!NT_STATUS_IS_OK(status)) {
DBG_ERR("Cannot connect to server: %s\n", nt_errstr(status));
- goto fail;
+ goto fail_free_messaging;
}
status = cli_rpc_pipe_open_noauth(cli, &ndr_table_mdssvc, &rpccli);
if (!NT_STATUS_IS_OK(status)) {
- goto fail;
+ goto fail_free_messaging;
}
status = mdscli_connect(frame,
&mdscli_ctx);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to connect mdssvc\n");
- goto fail;
+ goto fail_free_messaging;
}
if (opt_path == NULL) {
basepath = talloc_strdup(frame, opt_path);
}
if (basepath == NULL) {
- goto fail;
+ goto fail_free_messaging;
}
status = mdscli_search(frame,
&search);
if (!NT_STATUS_IS_OK(status)) {
printf("mdscli_search failed\n");
- goto fail;
+ goto fail_free_messaging;
}
if (!opt_live) {
}
if (!NT_STATUS_IS_OK(status)) {
printf("mdscli_get_results failed\n");
- goto fail;
+ goto fail_free_messaging;
}
ncnids = talloc_array_length(cnids);
if (!NT_STATUS_IS_OK(status)) {
printf("Get path for CNID 0x%"PRIx64" failed\n",
cnids[i]);
- goto fail;
+ goto fail_free_messaging;
}
printf("%s\n", path);
TALLOC_FREE(path);
status = mdscli_close_search(&search);
if (!NT_STATUS_IS_OK(status)) {
printf("mdscli_close_search failed\n");
- goto fail;
+ goto fail_free_messaging;
}
status = mdscli_disconnect(mdscli_ctx);
if (!NT_STATUS_IS_OK(status)) {
printf("mdscli_disconnect failed\n");
- goto fail;
+ goto fail_free_messaging;
}
cmdline_messaging_context_free();
poptFreeContext(pc);
return 0;
+fail_free_messaging:
+ cmdline_messaging_context_free();
fail:
poptFreeContext(pc);
TALLOC_FREE(frame);