repositories
/
deb_shairplay.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix a memory leak in raop
[deb_shairplay.git]
/
src
/
lib
/
raop.c
diff --git
a/src/lib/raop.c
b/src/lib/raop.c
index 9aafe65b18ef654e01303b7060e96629862cbae3..8ddb0887e8b541d486f739f28970ececc4836192 100644
(file)
--- a/
src/lib/raop.c
+++ b/
src/lib/raop.c
@@
-36,7
+36,7
@@
#define MAX_PASSWORD_LEN 64
/* MD5 as hex fits here */
#define MAX_PASSWORD_LEN 64
/* MD5 as hex fits here */
-#define MAX_NONCE_LEN 3
3
+#define MAX_NONCE_LEN 3
2
struct raop_s {
/* Callbacks for audio */
struct raop_s {
/* Callbacks for audio */
@@
-143,9
+143,10
@@
conn_request(void *ptr, http_request_t *request, http_response_t **response)
authorization = http_request_get_header(request, "Authorization");
if (authorization) {
authorization = http_request_get_header(request, "Authorization");
if (authorization) {
+ logger_log(&conn->raop->logger, LOGGER_DEBUG, "Our nonce: %s\n", conn->nonce);
logger_log(&conn->raop->logger, LOGGER_DEBUG, "Authorization: %s\n", authorization);
}
logger_log(&conn->raop->logger, LOGGER_DEBUG, "Authorization: %s\n", authorization);
}
- if (!digest_is_valid("AppleTV", raop->password, conn->nonce, method, authorization)) {
+ if (!digest_is_valid("AppleTV", raop->password, conn->nonce, method,
http_request_get_url(request),
authorization)) {
char *authstr;
int authstrlen;
char *authstr;
int authstrlen;
@@
-174,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");
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));
char signature[MAX_SIGNATURE_LEN];
memset(signature, 0, sizeof(signature));
@@
-288,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;
memcpy(datastr, data, datalen);
if (!strncmp(datastr, "volume: ", 8)) {
float vol = 0.0;
- sscanf(data+8, "%f", &vol);
+ sscanf(data
str
+8, "%f", &vol);
raop_rtp_set_volume(conn->raop_rtp, vol);
}
}
raop_rtp_set_volume(conn->raop_rtp, vol);
}
}
+ free(datastr);
} else if (!strcmp(method, "FLUSH")) {
const char *rtpinfo;
int next_seq = -1;
} else if (!strcmp(method, "FLUSH")) {
const char *rtpinfo;
int next_seq = -1;