fix some error checking

This commit is contained in:
josch
2014-12-05 14:40:04 +01:00
parent c04151f2e1
commit dd3291a9c4
3 changed files with 9 additions and 5 deletions

View File

@@ -74,14 +74,14 @@ int mfshell_cmd_get(mfshell * mfshell, int argc, char *const argv[])
// get file name
retval = mfconn_api_file_get_info(mfshell->conn, file, (char *)quickkey);
if (retval == -1) {
if (retval != 0) {
file_free(file);
return -1;
}
// request a direct download (streaming) link
retval = mfconn_api_file_get_links(mfshell->conn, file, (char *)quickkey);
if (retval == -1) {
if (retval != 0) {
file_free(file);
return -1;
}