mirror of
https://github.com/xorgy/mediafire-fuse
synced 2026-01-13 21:24:28 -08:00
fix valgrind problems
This commit is contained in:
@@ -156,6 +156,10 @@ const char *mfconn_create_call_signature(mfconn * conn, const char *url,
|
|||||||
signature_raw = strdup_printf("%d%s%s%s",
|
signature_raw = strdup_printf("%d%s%s%s",
|
||||||
(conn->secret_key % 256),
|
(conn->secret_key % 256),
|
||||||
conn->secret_time, api, args);
|
conn->secret_time, api, args);
|
||||||
|
if (signature_raw == NULL) {
|
||||||
|
fprintf(stderr, "strdup_printf failed\n");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
MD5((const unsigned char *)signature_raw,
|
MD5((const unsigned char *)signature_raw,
|
||||||
strlen(signature_raw), signature_enc);
|
strlen(signature_raw), signature_enc);
|
||||||
@@ -239,6 +243,11 @@ const char *mfconn_create_signed_get(mfconn * conn, int ssl,
|
|||||||
|
|
||||||
// append api GET args to api request
|
// append api GET args to api request
|
||||||
api_request = (char *)realloc(api_request, bytes_to_alloc);
|
api_request = (char *)realloc(api_request, bytes_to_alloc);
|
||||||
|
if (api_request == NULL) {
|
||||||
|
fprintf(stderr, "cannot allocate memory\n");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
strncat(api_request, api_args, api_args_len);
|
strncat(api_request, api_args, api_args_len);
|
||||||
strcat(api_request, signature);
|
strcat(api_request, signature);
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,10 @@ char *strdup_printf(char *fmt, ...)
|
|||||||
bytes_to_allocate++;
|
bytes_to_allocate++;
|
||||||
|
|
||||||
ret_str = (char *)malloc(bytes_to_allocate * sizeof(char));
|
ret_str = (char *)malloc(bytes_to_allocate * sizeof(char));
|
||||||
|
if (ret_str == NULL) {
|
||||||
|
fprintf(stderr, "failed to allocate memory\n");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
bytes_to_allocate = vsnprintf(ret_str, bytes_to_allocate, fmt, ap);
|
bytes_to_allocate = vsnprintf(ret_str, bytes_to_allocate, fmt, ap);
|
||||||
|
|||||||
@@ -58,11 +58,58 @@
|
|||||||
...
|
...
|
||||||
fun:curl_multi_perform
|
fun:curl_multi_perform
|
||||||
fun:curl_easy_perform
|
fun:curl_easy_perform
|
||||||
fun:http_post_buf
|
...
|
||||||
fun:mfconn_api_user_get_session_token
|
}
|
||||||
fun:mfconn_create
|
{
|
||||||
fun:mfshell_cmd_auth
|
libcurl #1
|
||||||
fun:mfshell_exec
|
Memcheck:Leak
|
||||||
fun:mfshell_parse_commands
|
...
|
||||||
fun:main
|
fun:curl_global_init
|
||||||
|
fun:curl_easy_init
|
||||||
|
...
|
||||||
|
}
|
||||||
|
{
|
||||||
|
libcurl #2
|
||||||
|
Memcheck:Cond
|
||||||
|
...
|
||||||
|
fun:curl_multi_perform
|
||||||
|
fun:curl_easy_perform
|
||||||
|
...
|
||||||
|
}
|
||||||
|
{
|
||||||
|
libcurl #3
|
||||||
|
Memcheck:Value8
|
||||||
|
fun:Curl_raw_toupper
|
||||||
|
...
|
||||||
|
}
|
||||||
|
{
|
||||||
|
libcrypto
|
||||||
|
Memcheck:Leak
|
||||||
|
...
|
||||||
|
fun:curl_multi_perform
|
||||||
|
fun:curl_easy_perform
|
||||||
|
...
|
||||||
|
}
|
||||||
|
{
|
||||||
|
openssl
|
||||||
|
Memcheck:Leak
|
||||||
|
fun:malloc
|
||||||
|
fun:CRYPTO_malloc
|
||||||
|
...
|
||||||
|
fun:ssl_verify_cert_chain
|
||||||
|
...
|
||||||
|
}
|
||||||
|
{
|
||||||
|
jansson #1
|
||||||
|
Memcheck:Cond
|
||||||
|
...
|
||||||
|
obj:*/libjansson.so*
|
||||||
|
...
|
||||||
|
}
|
||||||
|
{
|
||||||
|
jansson #2
|
||||||
|
Memcheck:Value8
|
||||||
|
...
|
||||||
|
obj:*/libjansson.so*
|
||||||
|
...
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user