[ClusterLabs] attrd: Fix sigsegv on exit if initialization failed

Ken Gaillot kgaillot at redhat.com
Thu Mar 17 00:30:36 CET 2016


On 10/12/2015 06:08 AM, Vladislav Bogdanov wrote:
> Hi,
> 
> This was caught with 0.17.1 libqb, which didn't play well with long pids.
> 
> commit 180a943846b6d94c27b9b984b039ac0465df64da
> Author: Vladislav Bogdanov <bubble at hoster-ok.com>
> Date:   Mon Oct 12 11:05:29 2015 +0000
> 
>     attrd: Fix sigsegv on exit if initialization failed
> 
> diff --git a/attrd/main.c b/attrd/main.c
> index 069e9fa..94e9212 100644
> --- a/attrd/main.c
> +++ b/attrd/main.c
> @@ -368,8 +368,12 @@ main(int argc, char **argv)
>      crm_notice("Cleaning up before exit");
> 
>      election_fini(writer);
> -    crm_client_disconnect_all(ipcs);
> -    qb_ipcs_destroy(ipcs);
> +
> +    if (ipcs) {
> +        crm_client_disconnect_all(ipcs);
> +        qb_ipcs_destroy(ipcs);
> +    }
> +
>      g_hash_table_destroy(attributes);
> 
>      if (the_cib) {

I set aside this message to merge it, then promptly lost it ... finally
ran across it again. It's merged into master now. Thanks for reporting
the problem and a patch.



More information about the Users mailing list