[pacman-dev] [PATCH] Fix several memleaks, mostly related to errors handling.

Aaron Griffin aaronmgriffin at gmail.com
Mon Nov 26 18:44:40 EST 2007


On Nov 26, 2007 5:31 PM, Xavier <shiningxc at gmail.com> wrote:
> Does it still look OK by using pm_errno instead of ret?
>
> MALLOC(miss, sizeof(pmdepmissing_t), pm_errno = PM_ERR_MEMORY);
> if(om_errno == PM_ERR_MEMORY) {
>         /* free the lists */
>         ret = -1;
>         goto cleanup;
> }
>
> I'm asking because I noticed MALLOC could be used in resolvedeps too, but
> there isn't already a ret variable there :)
> I made this change for resolvedeps in my working branch, and for sync_prepare
> in my sync branch.

You could also always just check if(!miss), which is what I'd do.
That's why I mentioned just doing nothing in the third param.

Either way it's the same thing, so just do what you're comfortable with.




More information about the pacman-dev mailing list