diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/abrt-action-bugzilla.c | 16 | ||||
-rw-r--r-- | src/plugins/rhbz.c | 28 | ||||
-rw-r--r-- | src/plugins/rhbz.h | 8 |
3 files changed, 24 insertions, 28 deletions
diff --git a/src/plugins/abrt-action-bugzilla.c b/src/plugins/abrt-action-bugzilla.c index 98a47043..ee678fe8 100644 --- a/src/plugins/abrt-action-bugzilla.c +++ b/src/plugins/abrt-action-bugzilla.c @@ -188,7 +188,6 @@ static void report_to_bugzilla(const char *dump_dir_name, map_string_h *settings } xmlrpc_DECREF(all_bugs); } - } free(product); @@ -203,19 +202,17 @@ static void report_to_bugzilla(const char *dump_dir_name, map_string_h *settings rhbz_attachments(client, bug_id_str, problem_data, RHBZ_NOMAIL_NOTIFY); - log(_("Logging out")); - rhbz_logout(client); - - log("Status: NEW %s/show_bug.cgi?id=%u", bugzilla_url, bug_id); - abrt_xmlrpc_free_client(client); - return; + bz = new_bug_info(); + bz->bi_status = xstrdup("NEW"); + bz->bi_id = bug_id; + goto log_out; } // decision based on state log(_("Bug is already reported: %i"), bz->bi_id); if ((strcmp(bz->bi_status, "CLOSED") == 0) - && (strcmp(bz->bi_resolution, "DUPLICATE") == 0)) - { + && (strcmp(bz->bi_resolution, "DUPLICATE") == 0) + ) { struct bug_info *origin; origin = rhbz_find_origin_bug_closed_duplicate(client, bz); if (origin) @@ -264,6 +261,7 @@ static void report_to_bugzilla(const char *dump_dir_name, map_string_h *settings } } + log_out: log(_("Logging out")); rhbz_logout(client); diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c index d7d583dd..83c3d20a 100644 --- a/src/plugins/rhbz.c +++ b/src/plugins/rhbz.c @@ -35,10 +35,10 @@ void free_bug_info(struct bug_info *bi) if (!bi) return; - free((void*)bi->bi_status); - free((void*)bi->bi_resolution); - free((void*)bi->bi_reporter); - free((void*)bi->bi_product); + free(bi->bi_status); + free(bi->bi_resolution); + free(bi->bi_reporter); + free(bi->bi_product); list_free_with_free(bi->bi_cc_list); @@ -174,18 +174,16 @@ void *rhbz_bug_read_item(const char *memb, xmlrpc_value *xml, int flags) return (void*)string; } + if (IS_READ_INT(flags)) { - if (IS_READ_INT(flags)) - { - int *integer = xmalloc(sizeof(int)); - xmlrpc_read_int(&env, member, integer); - xmlrpc_DECREF(member); - if (env.fault_occurred) - abrt_xmlrpc_die(&env); - - VERB3 log("found %s: '%i'", memb, *integer); - return (void*)integer; - } + int *integer = xmalloc(sizeof(int)); + xmlrpc_read_int(&env, member, integer); + xmlrpc_DECREF(member); + if (env.fault_occurred) + abrt_xmlrpc_die(&env); + + VERB3 log("found %s: '%i'", memb, *integer); + return (void*)integer; } die: free((void*)string); diff --git a/src/plugins/rhbz.h b/src/plugins/rhbz.h index f44ca191..60d64070 100644 --- a/src/plugins/rhbz.h +++ b/src/plugins/rhbz.h @@ -49,10 +49,10 @@ struct bug_info { int bi_id; int bi_dup_id; - const char *bi_status; - const char *bi_resolution; - const char *bi_reporter; - const char *bi_product; + char *bi_status; + char *bi_resolution; + char *bi_reporter; + char *bi_product; GList *bi_cc_list; }; |