Fix a memory leak in raop
authorJuho Vähä-Herttua <juhovh@iki.fi>
Wed, 21 Mar 2012 12:23:57 +0000 (14:23 +0200)
committerJuho Vähä-Herttua <juhovh@iki.fi>
Wed, 16 May 2012 21:33:32 +0000 (00:33 +0300)
src/lib/raop.c

index cd99b53b77c19b3f65ecd56dd0814889ae9da87b..8ddb0887e8b541d486f739f28970ececc4836192 100644 (file)
@@ -289,10 +289,11 @@ conn_request(void *ptr, http_request_t *request, http_response_t **response)
                        memcpy(datastr, data, datalen);
                        if (!strncmp(datastr, "volume: ", 8)) {
                                float vol = 0.0;
-                               sscanf(data+8, "%f", &vol);
+                               sscanf(datastr+8, "%f", &vol);
                                raop_rtp_set_volume(conn->raop_rtp, vol);
                        }
                }
+               free(datastr);
        } else if (!strcmp(method, "FLUSH")) {
                const char *rtpinfo;
                int next_seq = -1;