Add valgrind tests and fix memleaks

This commit is contained in:
josch
2014-09-21 00:03:20 +02:00
parent 122db2ed82
commit 042a1cdf09
16 changed files with 177 additions and 18 deletions

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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 =