From: Andrzej Popowski Date: Mon, 8 Jun 2015 13:13:09 +0000 (+0200) Subject: [Download] - fixing memory leaks X-Git-Tag: accepted/tizen/tv/20150615.001251^2~2^2~28^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=320db534593310be20544261b89767d10cd1019d;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Download] - fixing memory leaks Change-Id: Ia274fd8f4b2a45f98500f12e0c897f9c336e58d4 Signed-off-by: Andrzej Popowski --- diff --git a/src/download/download_instance.cc b/src/download/download_instance.cc index 8b4ca3e..abcf635 100755 --- a/src/download/download_instance.cc +++ b/src/download/download_instance.cc @@ -202,6 +202,9 @@ gboolean DownloadInstance::OnFinished(void* user_data) { out["fullPath"] = picojson::value(fullPath); downCbPtr->instance->PostMessage(picojson::value(out).serialize().c_str()); + + free(fullPath); + return FALSE; } @@ -757,17 +760,18 @@ void DownloadInstance::DownloadManagerGetmimetype } else if (ret == DOWNLOAD_ERROR_INVALID_PARAMETER) { ReportError(InvalidValuesException( "The input parameter contains an invalid value."), out); - } else if (ret == DOWNLOAD_ERROR_OUT_OF_MEMORY) { - ReportError(UnknownException("Out of memory"), out); - } else if (ret == DOWNLOAD_ERROR_INVALID_STATE) { - ReportError(InvalidValuesException("Invalid state"), out); - } else if (ret == DOWNLOAD_ERROR_IO_ERROR) { - ReportError(UnknownException("Internal I/O error"), out); - } else if (ret == DOWNLOAD_ERROR_PERMISSION_DENIED) { - ReportError(UnknownException("Permission denied"), out); - } else { - ReportError(UnknownException("Unknown Error"), out); - } + } else if (ret == DOWNLOAD_ERROR_OUT_OF_MEMORY) { + ReportError(UnknownException("Out of memory"), out); + } else if (ret == DOWNLOAD_ERROR_INVALID_STATE) { + ReportError(InvalidValuesException("Invalid state"), out); + } else if (ret == DOWNLOAD_ERROR_IO_ERROR) { + ReportError(UnknownException("Internal I/O error"), out); + } else if (ret == DOWNLOAD_ERROR_PERMISSION_DENIED) { + ReportError(UnknownException("Permission denied"), out); + } else { + ReportError(UnknownException("Unknown Error"), out); + } + free(mimetype); } bool DownloadInstance::GetDownloadID