summaryrefslogtreecommitdiff
path: root/librpc/ndr
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-06-11 20:53:05 +0200
committerJeremy Allison <jra@samba.org>2013-06-11 13:21:12 -0700
commitecff2b25340daf38c326c2b9431568fee53ff78e (patch)
tree7e95f4c637615cfd2986bbfad24b03cb830e475b /librpc/ndr
parent1b740e5033d4adf4e3412bc2be7d9d4ff77ae271 (diff)
downloadsamba-ecff2b25340daf38c326c2b9431568fee53ff78e.tar.gz
samba-ecff2b25340daf38c326c2b9431568fee53ff78e.tar.bz2
samba-ecff2b25340daf38c326c2b9431568fee53ff78e.zip
librpc: Fix some "ignored asprint result" warnings
While there, it removes some alloc/free calls Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'librpc/ndr')
-rw-r--r--librpc/ndr/ndr_orpc.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/librpc/ndr/ndr_orpc.c b/librpc/ndr/ndr_orpc.c
index 6a55048e43..936a56b5e6 100644
--- a/librpc/ndr/ndr_orpc.c
+++ b/librpc/ndr/ndr_orpc.c
@@ -93,23 +93,17 @@ void ndr_print_DUALSTRINGARRAY(struct ndr_print *ndr, const char *name, const st
ndr->print(ndr, "STRING BINDINGS");
ndr->depth++;
for (i=0;ar->stringbindings[i];i++) {
- char *idx = NULL;
- asprintf(&idx, "[%d]", i);
- if (idx) {
- ndr_print_STRINGBINDING(ndr, idx, ar->stringbindings[i]);
- free(idx);
- }
+ char idx[13]; /* 2^32 has 10 digits */
+ snprintf(idx, sizeof(idx), "[%d]", i);
+ ndr_print_STRINGBINDING(ndr, idx, ar->stringbindings[i]);
}
ndr->depth--;
ndr->print(ndr, "SECURITY BINDINGS");
ndr->depth++;
for (i=0;ar->securitybindings[i];i++) {
- char *idx = NULL;
- asprintf(&idx, "[%d]", i);
- if (idx) {
- ndr_print_SECURITYBINDING(ndr, idx, ar->securitybindings[i]);
- free(idx);
- }
+ char idx[13]; /* 2^32 has 10 digits */
+ snprintf(idx, sizeof(idx), "[%d]", i);
+ ndr_print_SECURITYBINDING(ndr, idx, ar->securitybindings[i]);
}
ndr->depth--;
}
@@ -162,12 +156,9 @@ void ndr_print_STRINGARRAY(struct ndr_print *ndr, const char *name, const struct
ndr->print(ndr, "%-25s: STRINGARRAY", name);
ndr->depth++;
for (i=0;ar->stringbindings[i];i++) {
- char *idx = NULL;
- asprintf(&idx, "[%d]", i);
- if (idx) {
- ndr_print_STRINGBINDING(ndr, idx, ar->stringbindings[i]);
- free(idx);
- }
+ char idx[13]; /* 2^32 has 10 digits */
+ snprintf(idx, sizeof(idx), "[%d]", i);
+ ndr_print_STRINGBINDING(ndr, idx, ar->stringbindings[i]);
}
ndr->depth--;
}