strippwd patch against CVS20041108

Andrew V. Samoilov andrew at email.zp.ua
Thu Nov 11 08:27:31 UTC 2004


Hello Jindrich,
> About the (add2hotlist_cmd): Eliminate static label_string:
> 
> I implemented the label_string to be static in order to your comment #16
> on Red Hat bugzilla:
> 
> https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=131088
> 
> where you replied to my question where the label_string is leaked in my
> original implementation of strippwd patch (where label_string is
> g_strdup()ed):
> 
> AVS >label_string is leaked if input_dialog() returns NULL or empty
> string.
> AVS >In last case this memory (g_strdup("")) is also leaked.
> 
> From the patch I see you reintroduced this. Otherwise please make it
> clear to me.

I added these lines to fix memory leak and to eliminate static buffer:

    if (!label || !*label) {
        g_free (label_string);
        g_free (label);
        return;
    }

-- 
Regards,
Andrew V. Samoilov.




More information about the mc-devel mailing list