[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.11-90-g9996213

Lennart Poettering gitmailer-noreply at 0pointer.de
Sat Aug 9 07:12:58 PDT 2008


This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.

The master branch has been updated
      from  15cebbacebf27703848afb18883fad7984349f04 (commit)

- Log -----------------------------------------------------------------
9996213... free regex_t after use
-----------------------------------------------------------------------

Summary of changes:
 src/pulsecore/core-util.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

-----------------------------------------------------------------------

commit 9996213c411e1d90940758d2c91b4d50517a30f2
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Aug 9 16:12:50 2008 +0200

    free regex_t after use

diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 0717ff1..5841df0 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -693,6 +693,7 @@ void pa_reset_priority(void) {
 static int match(const char *expr, const char *v) {
     int k;
     regex_t re;
+    int r;
 
     if (regcomp(&re, expr, REG_NOSUB|REG_EXTENDED) != 0) {
         errno = EINVAL;
@@ -700,12 +701,18 @@ static int match(const char *expr, const char *v) {
     }
 
     if ((k = regexec(&re, v, 0, NULL, 0)) == 0)
-        return 1;
+        r = 1;
     else if (k == REG_NOMATCH)
-        return 0;
+        r = 0;
+    else
+        r = -1;
 
-    errno = EINVAL;
-    return -1;
+    regfree(&re);
+
+    if (r < 0)
+        errno = EINVAL;
+
+    return r;
 }
 
 /* Try to parse a boolean string value.*/

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list