From 9712e3c11c69e2a40ea7c156dd3515dafed833ea Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 23 Feb 2008 10:54:59 +0100 Subject: make idl: Check return value of asprintf (This used to be commit d9fb7d7bdcd0e54838ff0b1cb64a7e75d8cd726a) --- source3/librpc/gen_ndr/ndr_epmapper.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'source3/librpc/gen_ndr/ndr_epmapper.c') diff --git a/source3/librpc/gen_ndr/ndr_epmapper.c b/source3/librpc/gen_ndr/ndr_epmapper.c index 4f9422ea57..2e709e11e0 100644 --- a/source3/librpc/gen_ndr/ndr_epmapper.c +++ b/source3/librpc/gen_ndr/ndr_epmapper.c @@ -1566,8 +1566,7 @@ _PUBLIC_ void ndr_print_epm_tower(struct ndr_print *ndr, const char *name, const ndr->depth++; for (cntr_floors_0=0;cntr_floors_0num_floors;cntr_floors_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_floors_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_floors_0) != -1) { ndr_print_epm_floor(ndr, "floors", &r->floors[cntr_floors_0]); free(idx_0); } @@ -1849,8 +1848,7 @@ _PUBLIC_ void ndr_print_epm_Insert(struct ndr_print *ndr, const char *name, int ndr->depth++; for (cntr_entries_0=0;cntr_entries_0in.num_ents;cntr_entries_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_entries_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_entries_0) != -1) { ndr_print_epm_entry_t(ndr, "entries", &r->in.entries[cntr_entries_0]); free(idx_0); } @@ -1930,8 +1928,7 @@ _PUBLIC_ void ndr_print_epm_Delete(struct ndr_print *ndr, const char *name, int ndr->depth++; for (cntr_entries_0=0;cntr_entries_0in.num_ents;cntr_entries_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_entries_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_entries_0) != -1) { ndr_print_epm_entry_t(ndr, "entries", &r->in.entries[cntr_entries_0]); free(idx_0); } @@ -2131,8 +2128,7 @@ _PUBLIC_ void ndr_print_epm_Lookup(struct ndr_print *ndr, const char *name, int ndr->depth++; for (cntr_entries_0=0;cntr_entries_0<*r->out.num_ents;cntr_entries_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_entries_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_entries_0) != -1) { ndr_print_epm_entry_t(ndr, "entries", &r->out.entries[cntr_entries_0]); free(idx_0); } @@ -2321,8 +2317,7 @@ _PUBLIC_ void ndr_print_epm_Map(struct ndr_print *ndr, const char *name, int fla ndr->depth++; for (cntr_towers_0=0;cntr_towers_0<*r->out.num_towers;cntr_towers_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_towers_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_towers_0) != -1) { ndr_print_epm_twr_p_t(ndr, "towers", &r->out.towers[cntr_towers_0]); free(idx_0); } -- cgit