Fix a small memory leak in raop_buffer.
[deb_shairplay.git] / src / lib / raop.c
index 1994ed373e833d18399ab079ac0fddcad17a29aa..8ddb0887e8b541d486f739f28970ececc4836192 100644 (file)
@@ -175,7 +175,7 @@ conn_request(void *ptr, http_request_t *request, http_response_t **response)
        http_response_add_header(res, "Apple-Jack-Status", "connected; type=analog");
 
        challenge = http_request_get_header(request, "Apple-Challenge");
-       if (challenge) {
+       if (!require_auth && challenge) {
                char signature[MAX_SIGNATURE_LEN];
 
                memset(signature, 0, sizeof(signature));
@@ -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;