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_dfs.c | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) (limited to 'source3/librpc/gen_ndr/ndr_dfs.c') diff --git a/source3/librpc/gen_ndr/ndr_dfs.c b/source3/librpc/gen_ndr/ndr_dfs.c index f5ce913bd2..2e9873e929 100644 --- a/source3/librpc/gen_ndr/ndr_dfs.c +++ b/source3/librpc/gen_ndr/ndr_dfs.c @@ -506,8 +506,7 @@ _PUBLIC_ void ndr_print_dfs_Info3(struct ndr_print *ndr, const char *name, const ndr->depth++; for (cntr_stores_1=0;cntr_stores_1num_stores;cntr_stores_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_stores_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_stores_1) != -1) { ndr_print_dfs_StorageInfo(ndr, "stores", &r->stores[cntr_stores_1]); free(idx_1); } @@ -670,8 +669,7 @@ _PUBLIC_ void ndr_print_dfs_Info4(struct ndr_print *ndr, const char *name, const ndr->depth++; for (cntr_stores_1=0;cntr_stores_1num_stores;cntr_stores_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_stores_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_stores_1) != -1) { ndr_print_dfs_StorageInfo(ndr, "stores", &r->stores[cntr_stores_1]); free(idx_1); } @@ -1079,8 +1077,7 @@ _PUBLIC_ void ndr_print_dfs_Info6(struct ndr_print *ndr, const char *name, const ndr->depth++; for (cntr_stores_1=0;cntr_stores_1num_stores;cntr_stores_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_stores_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_stores_1) != -1) { ndr_print_dfs_StorageInfo2(ndr, "stores", &r->stores[cntr_stores_1]); free(idx_1); } @@ -2271,8 +2268,7 @@ _PUBLIC_ void ndr_print_dfs_EnumArray1(struct ndr_print *ndr, const char *name, ndr->depth++; for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_s_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { ndr_print_dfs_Info1(ndr, "s", &r->s[cntr_s_1]); free(idx_1); } @@ -2358,8 +2354,7 @@ _PUBLIC_ void ndr_print_dfs_EnumArray2(struct ndr_print *ndr, const char *name, ndr->depth++; for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_s_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { ndr_print_dfs_Info2(ndr, "s", &r->s[cntr_s_1]); free(idx_1); } @@ -2445,8 +2440,7 @@ _PUBLIC_ void ndr_print_dfs_EnumArray3(struct ndr_print *ndr, const char *name, ndr->depth++; for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_s_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { ndr_print_dfs_Info3(ndr, "s", &r->s[cntr_s_1]); free(idx_1); } @@ -2532,8 +2526,7 @@ _PUBLIC_ void ndr_print_dfs_EnumArray4(struct ndr_print *ndr, const char *name, ndr->depth++; for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_s_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { ndr_print_dfs_Info4(ndr, "s", &r->s[cntr_s_1]); free(idx_1); } @@ -2619,8 +2612,7 @@ _PUBLIC_ void ndr_print_dfs_EnumArray5(struct ndr_print *ndr, const char *name, ndr->depth++; for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_s_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { ndr_print_dfs_Info5(ndr, "s", &r->s[cntr_s_1]); free(idx_1); } @@ -2706,8 +2698,7 @@ _PUBLIC_ void ndr_print_dfs_EnumArray6(struct ndr_print *ndr, const char *name, ndr->depth++; for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_s_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { ndr_print_dfs_Info6(ndr, "s", &r->s[cntr_s_1]); free(idx_1); } @@ -2793,8 +2784,7 @@ _PUBLIC_ void ndr_print_dfs_EnumArray200(struct ndr_print *ndr, const char *name ndr->depth++; for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_s_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { ndr_print_dfs_Info200(ndr, "s", &r->s[cntr_s_1]); free(idx_1); } @@ -2880,8 +2870,7 @@ _PUBLIC_ void ndr_print_dfs_EnumArray300(struct ndr_print *ndr, const char *name ndr->depth++; for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_s_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { ndr_print_dfs_Info300(ndr, "s", &r->s[cntr_s_1]); free(idx_1); } -- cgit