summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-12-31 18:06:57 -0800
committerJeremy Allison <jra@samba.org>2008-12-31 18:06:57 -0800
commit07e0094365e8dc360a83eec2e7cf9b1d5d8d6d00 (patch)
tree412f448d68b4b0f36c5b330a1f3eef77acf12a2f /source3/rpcclient
parentbb23f5725f538d14b2ccec0463cfb1136be3ebd0 (diff)
downloadsamba-07e0094365e8dc360a83eec2e7cf9b1d5d8d6d00.tar.gz
samba-07e0094365e8dc360a83eec2e7cf9b1d5d8d6d00.tar.bz2
samba-07e0094365e8dc360a83eec2e7cf9b1d5d8d6d00.zip
Fix all warnings in source3 with gcc4.3.
Jeremy.
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_spoolss.c45
1 files changed, 35 insertions, 10 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index 038acfbcdc..ecd0f36217 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -1655,9 +1655,14 @@ static WERROR cmd_spoolss_addform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
/* Get a printer handle */
- asprintf(&servername, "\\\\%s", cli->desthost);
+ if (asprintf(&servername, "\\\\%s", cli->desthost) == -1) {
+ return WERR_NOMEM;
+ }
strupper_m(servername);
- asprintf(&printername, "%s\\%s", servername, argv[1]);
+ if (asprintf(&printername, "%s\\%s", servername, argv[1]) == -1) {
+ SAFE_FREE(servername);
+ return WERR_NOMEM;
+ }
werror = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername, "",
PRINTER_ALL_ACCESS,
@@ -1716,9 +1721,14 @@ static WERROR cmd_spoolss_setform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
/* Get a printer handle */
- asprintf(&servername, "\\\\%s", cli->desthost);
+ if (asprintf(&servername, "\\\\%s", cli->desthost)) {
+ return WERR_NOMEM;
+ }
strupper_m(servername);
- asprintf(&printername, "%s\\%s", servername, argv[1]);
+ if (asprintf(&printername, "%s\\%s", servername, argv[1]) == -1) {
+ SAFE_FREE(servername);
+ return WERR_NOMEM;
+ }
werror = rpccli_spoolss_open_printer_ex(
cli, mem_ctx, printername, "", MAXIMUM_ALLOWED_ACCESS,
@@ -1813,9 +1823,14 @@ static WERROR cmd_spoolss_getform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
/* Get a printer handle */
- asprintf(&servername, "\\\\%s", cli->desthost);
+ if (asprintf(&servername, "\\\\%s", cli->desthost) == -1) {
+ return WERR_NOMEM;
+ }
strupper_m(servername);
- asprintf(&printername, "%s\\%s", servername, argv[1]);
+ if (asprintf(&printername, "%s\\%s", servername, argv[1])) {
+ SAFE_FREE(servername);
+ return WERR_NOMEM;
+ }
werror = rpccli_spoolss_open_printer_ex(
cli, mem_ctx, printername, "", MAXIMUM_ALLOWED_ACCESS,
@@ -1866,9 +1881,14 @@ static WERROR cmd_spoolss_deleteform(struct rpc_pipe_client *cli,
/* Get a printer handle */
- asprintf(&servername, "\\\\%s", cli->desthost);
+ if (asprintf(&servername, "\\\\%s", cli->desthost) == -1) {
+ return WERR_NOMEM;
+ }
strupper_m(servername);
- asprintf(&printername, "%s\\%s", servername, argv[1]);
+ if (asprintf(&printername, "%s\\%s", servername, argv[1]) == -1) {
+ SAFE_FREE(servername);
+ return WERR_NOMEM;
+ }
werror = rpccli_spoolss_open_printer_ex(
cli, mem_ctx, printername, "", MAXIMUM_ALLOWED_ACCESS,
@@ -1916,9 +1936,14 @@ static WERROR cmd_spoolss_enum_forms(struct rpc_pipe_client *cli,
/* Get a printer handle */
- asprintf(&servername, "\\\\%s", cli->desthost);
+ if (asprintf(&servername, "\\\\%s", cli->desthost) == -1) {
+ return WERR_NOMEM;
+ }
strupper_m(servername);
- asprintf(&printername, "%s\\%s", servername, argv[1]);
+ if (asprintf(&printername, "%s\\%s", servername, argv[1]) == -1) {
+ SAFE_FREE(servername);
+ return WERR_NOMEM;
+ }
werror = rpccli_spoolss_open_printer_ex(
cli, mem_ctx, printername, "", MAXIMUM_ALLOWED_ACCESS,