From c2e3db9254f058830d2ef7106d74d20a7fa56c75 Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> Date: Thu, 16 Sep 1999 15:45:15 +0000 Subject: gjavah.c (get_field_name, [...]): Use xmalloc, not malloc. * gjavah.c (get_field_name, print_method_info, print_include, add_namelet): Use xmalloc, not malloc. * jcf-depend.c (add_entry): Likewise. Use xstrdup, not strdup. (munge): Use xrealloc, not realloc, trust xrealloc to handle a NULL pointer. * jcf-io.c (open_in_zip, find_class): Use xstrdup, not strdup. * jcf-parse.c (jcf_out_of_synch, yyparse): Likewise. * jcf-path.c (add_entry): Likewise. * jcf.h (ALLOC, REALLOC): Use xmalloc/xrealloc, not malloc/realloc. * jv-scan.c (xmalloc): Remove definition. * jvgenmain.c (xmalloc): Likewise. * jvspec.c (lang_specific_driver): Use xcalloc, not xmalloc/bzero. * lex.c (java_store_unicode): Use xrealloc, not realloc. * parse-scan.y: Use concat, not of xmalloc/assign/strcpy. Use concat, not xmalloc/sprintf. (java_push_parser_context): Use xcalloc, not xmalloc/bzero. (xstrdup): Remove definition. * parse.y (duplicate_declaration_error_p, constructor_circularity_msg, verify_constructor_circularity, check_abstract_method_definitions, java_check_regular_methods, java_check_abstract_methods, patch_method_invocation, check_for_static_method_reference, patch_assignment, patch_binop, patch_cast, array_constructor_check_entry, patch_return, patch_conditional_expr): Use xstrdup, not strdup. * zextract.c (ALLOC): Use xmalloc, not malloc. From-SVN: r29457 --- gcc/java/jcf-depend.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'gcc/java/jcf-depend.c') diff --git a/gcc/java/jcf-depend.c b/gcc/java/jcf-depend.c index 87b474c..ca0b246 100644 --- a/gcc/java/jcf-depend.c +++ b/gcc/java/jcf-depend.c @@ -90,8 +90,8 @@ add_entry (entp, name) if (! strcmp (ent->file, name)) return; - ent = (struct entry *) malloc (sizeof (struct entry)); - ent->file = strdup (name); + ent = (struct entry *) xmalloc (sizeof (struct entry)); + ent->file = xstrdup (name); ent->next = *entp; *entp = ent; } @@ -177,10 +177,7 @@ munge (filename) if (buflen < len) { buflen = len; - if (buffer == NULL) - buffer = malloc (buflen); - else - buffer = realloc (buffer, buflen); + buffer = xrealloc (buffer, buflen); } dst = buffer; -- cgit v1.1