Hadn't noticed the lack of goto in module-bluetooth-policy.c... Given that it seems to be the usual pattern, would it be preferable to send a set of two patches: the first swapping out the "return -1" for a "goto fail" in module-bluetooth-policy.c:pa__init and the second patch being this one?
Jason --- Now instead of four in the eights place / you’ve got three, ‘Cause you added one / (That is to say, eight) to the two, / But you can’t take seven from three, / So you look at the sixty-fours.... On Mon, Jan 11, 2016 at 5:55 AM, David Henningsson <[email protected]> wrote: > Hi! > > The module-bluez5-discover.c one is correct, but the > module-bluetooth-policy.c does not go to the fail label in case of modargs > failure, so there is no need for the NULL check there. > > Do you want to send a new version of the patch or should I just strip half > of your patch and commit the other half? > > > On 2016-01-09 08:37, Jason Gerecke wrote: >> >> If 'pa_modargs_new' returns a NULL, we need to be careful to not call >> 'pa_modargs_free' in the failure path since it requires that we pass it >> a non-null argument. >> >> Signed-off-by: Jason Gerecke <[email protected]> >> --- >> src/modules/bluetooth/module-bluetooth-policy.c | 3 ++- >> src/modules/bluetooth/module-bluez5-discover.c | 3 ++- >> 2 files changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/src/modules/bluetooth/module-bluetooth-policy.c >> b/src/modules/bluetooth/module-bluetooth-policy.c >> index fc709ec..ede7c5f 100644 >> --- a/src/modules/bluetooth/module-bluetooth-policy.c >> +++ b/src/modules/bluetooth/module-bluetooth-policy.c >> @@ -261,7 +261,8 @@ int pa__init(pa_module *m) { >> return 0; >> >> fail: >> - pa_modargs_free(ma); >> + if (ma) >> + pa_modargs_free(ma); >> return -1; >> } >> >> diff --git a/src/modules/bluetooth/module-bluez5-discover.c >> b/src/modules/bluetooth/module-bluez5-discover.c >> index 1ccc1d1..080e5d0 100644 >> --- a/src/modules/bluetooth/module-bluez5-discover.c >> +++ b/src/modules/bluetooth/module-bluez5-discover.c >> @@ -137,7 +137,8 @@ int pa__init(pa_module *m) { >> return 0; >> >> fail: >> - pa_modargs_free(ma); >> + if (ma) >> + pa_modargs_free(ma); >> pa__done(m); >> return -1; >> } >> > > -- > David Henningsson, Canonical Ltd. > https://launchpad.net/~diwic > _______________________________________________ > pulseaudio-discuss mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss _______________________________________________ pulseaudio-discuss mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
