[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] switch-on-connect: Fix warning on discarded const qualifier
Georg Chini
gitlab at gitlab.freedesktop.org
Fri Nov 22 19:26:29 UTC 2019
Georg Chini pushed to branch master at PulseAudio / pulseaudio
Commits:
26a66d10 by Arun Raghavan at 2019-11-22T17:02:16Z
switch-on-connect: Fix warning on discarded const qualifier
pa_modargs_get_value() returns a const string -- instead of discarding
the const qualifier, let's just duplicate the string and free it
explicitly in the failure case.
- - - - -
1 changed file:
- src/modules/module-switch-on-connect.c
Changes:
=====================================
src/modules/module-switch-on-connect.c
=====================================
@@ -249,12 +249,10 @@ int pa__init(pa_module*m) {
goto fail;
}
- u->blacklist = pa_modargs_get_value(ma, "blacklist", NULL);
- if (u->blacklist != NULL && pa_is_regex_valid(u->blacklist)) {
- /* String returned above will be freed with modargs, duplicate it */
- u->blacklist = pa_xstrdup(u->blacklist);
- } else if (u->blacklist != NULL) {
- pa_log_error("A blacklist pattern was provided but is not a valid regex.");
+ u->blacklist = pa_xstrdup(pa_modargs_get_value(ma, "blacklist", NULL));
+ if (u->blacklist != NULL && !pa_is_regex_valid(u->blacklist)) {
+ pa_log_error("A blacklist pattern was provided but is not a valid regex");
+ pa_xfree(u->blacklist);
goto fail;
}
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/commit/26a66d103fd4bb6b93f5ef025cfe20b0e08ff63c
--
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/commit/26a66d103fd4bb6b93f5ef025cfe20b0e08ff63c
You're receiving this email because of your account on gitlab.freedesktop.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20191122/0b6b68b3/attachment.html>
More information about the pulseaudio-commits
mailing list