Forwarded: Jos Lemmens <acjlemmens@gmail.com>

---
 src/common.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- a/src/common.c
+++ b/src/common.c
@@ -976,12 +976,15 @@ void check_pulseaudio_device (misc_t *mi
       *strchr (str, '\n') = 0; // remove new_line
       if (strncasecmp (str, "Sink #", 6) != 0)
          continue;
-      str += 6;
-      if (atoi (str) == misc->pulseaudio_device)
+      if (atoi (str + 6) == misc->pulseaudio_device)
       {
+         free (str);
          pclose (p);
          return;
       } // if
+      free (str);
+      str = NULL;
+      len = 0;
    } // while
    pclose (p);
    select_next_output_device (misc, daisy);
