mirror of
https://github.com/xorgy/mediafire-fuse
synced 2026-01-13 13:14:29 -08:00
Add valgrind tests and fix memleaks
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <jansson.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../../utils/http.h"
|
||||
@@ -58,6 +59,8 @@ int mfconn_api_file_get_info(mfconn * conn, mffile * file, char *quickkey)
|
||||
retval = http_get_buf(http, api_call, _decode_file_get_info, file);
|
||||
http_destroy(http);
|
||||
|
||||
free(api_call);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <jansson.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../../utils/http.h"
|
||||
@@ -58,6 +59,8 @@ int mfconn_api_file_get_links(mfconn * conn, mffile * file, char *quickkey)
|
||||
retval = http_get_buf(http, api_call, _decode_file_get_links, file);
|
||||
http_destroy(http);
|
||||
|
||||
free(api_call);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../../utils/http.h"
|
||||
@@ -63,5 +64,7 @@ int mfconn_api_folder_create(mfconn * conn, char *parent, char *name)
|
||||
retval = http_get_buf(http, api_call, NULL, NULL);
|
||||
http_destroy(http);
|
||||
|
||||
free(api_call);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../../utils/http.h"
|
||||
@@ -47,5 +48,7 @@ int mfconn_api_folder_delete(mfconn * conn, const char *folderkey)
|
||||
retval = http_get_buf(http, api_call, NULL, NULL);
|
||||
http_destroy(http);
|
||||
|
||||
free(api_call);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -75,6 +75,8 @@ mfconn_api_folder_get_content(mfconn * conn, int mode, mffolder * folder_curr)
|
||||
_decode_folder_get_content_files, NULL);
|
||||
http_destroy(http);
|
||||
|
||||
free(api_call);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <jansson.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../../utils/http.h"
|
||||
@@ -58,6 +59,8 @@ mfconn_api_folder_get_info(mfconn * conn, mffolder * folder, char *folderkey)
|
||||
retval = http_get_buf(http, api_call, _decode_folder_get_info, folder);
|
||||
http_destroy(http);
|
||||
|
||||
free(api_call);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <jansson.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "../../utils/http.h"
|
||||
#include "../../utils/json.h"
|
||||
@@ -45,6 +46,8 @@ int mfconn_api_user_get_info(mfconn * conn)
|
||||
retval = http_get_buf(http, api_call, _decode_user_get_info, NULL);
|
||||
http_destroy(http);
|
||||
|
||||
free(api_call);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ mfconn_api_user_get_session_token(mfconn * conn, char *server,
|
||||
"&token_version=2"
|
||||
"&response_format=json",
|
||||
username, password, user_signature);
|
||||
free(user_signature);
|
||||
|
||||
http = http_create();
|
||||
retval =
|
||||
|
||||
Reference in New Issue
Block a user