|
@@ -30,6 +30,12 @@
|
|
|
# include <winsock2.h>
|
|
# include <winsock2.h>
|
|
|
# include <mstcpip.h>
|
|
# include <mstcpip.h>
|
|
|
#endif
|
|
#endif
|
|
|
|
|
+#ifdef DMALLOC
|
|
|
|
|
+#include <stdlib.h>
|
|
|
|
|
+#include <string.h>
|
|
|
|
|
+#include <dmalloc.h>
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
#include "miner.h"
|
|
#include "miner.h"
|
|
|
#include "elist.h"
|
|
#include "elist.h"
|
|
|
#include "compat.h"
|
|
#include "compat.h"
|
|
@@ -364,10 +370,15 @@ json_t *json_rpc_call(CURL *curl, const char *url,
|
|
|
if (probing) {
|
|
if (probing) {
|
|
|
pool->probed = true;
|
|
pool->probed = true;
|
|
|
/* If X-Long-Polling was found, activate long polling */
|
|
/* If X-Long-Polling was found, activate long polling */
|
|
|
- if (hi.lp_path)
|
|
|
|
|
|
|
+ if (hi.lp_path) {
|
|
|
|
|
+ if (pool->hdr_path != NULL)
|
|
|
|
|
+ free(pool->hdr_path);
|
|
|
pool->hdr_path = hi.lp_path;
|
|
pool->hdr_path = hi.lp_path;
|
|
|
- else
|
|
|
|
|
|
|
+ } else {
|
|
|
pool->hdr_path = NULL;
|
|
pool->hdr_path = NULL;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (hi.lp_path) {
|
|
|
|
|
+ free(hi.lp_path);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
*rolltime = hi.has_rolltime;
|
|
*rolltime = hi.has_rolltime;
|
|
@@ -410,9 +421,11 @@ json_t *json_rpc_call(CURL *curl, const char *url,
|
|
|
goto err_out;
|
|
goto err_out;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (hi.reason)
|
|
|
|
|
|
|
+ if (hi.reason) {
|
|
|
json_object_set_new(val, "reject-reason", json_string(hi.reason));
|
|
json_object_set_new(val, "reject-reason", json_string(hi.reason));
|
|
|
-
|
|
|
|
|
|
|
+ free(hi.reason);
|
|
|
|
|
+ hi.reason = NULL;
|
|
|
|
|
+ }
|
|
|
successful_connect = true;
|
|
successful_connect = true;
|
|
|
databuf_free(&all_data);
|
|
databuf_free(&all_data);
|
|
|
curl_slist_free_all(headers);
|
|
curl_slist_free_all(headers);
|