diff options
| author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-08-24 13:07:44 +0200 |
|---|---|---|
| committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-08-24 13:07:44 +0200 |
| commit | 5cc439c2c24859accf8a94d8a91879ad6d967ea4 (patch) | |
| tree | 1915379ff53eeb579ed92d889b7e6d873df1144a /lib/plugins/FileTransfer.cpp | |
| parent | be100446ebd3b1c8f6bb3ed450867c9dcbc625e8 (diff) | |
| download | abrt-5cc439c2c24859accf8a94d8a91879ad6d967ea4.tar.gz abrt-5cc439c2c24859accf8a94d8a91879ad6d967ea4.tar.xz abrt-5cc439c2c24859accf8a94d8a91879ad6d967ea4.zip | |
concat_path_file: make it a C function, not C++
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'lib/plugins/FileTransfer.cpp')
| -rw-r--r-- | lib/plugins/FileTransfer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/plugins/FileTransfer.cpp b/lib/plugins/FileTransfer.cpp index cf7cf1f3..05820d05 100644 --- a/lib/plugins/FileTransfer.cpp +++ b/lib/plugins/FileTransfer.cpp @@ -55,7 +55,7 @@ void CFileTransfer::SendFile(const char *pURL, const char *pFilename) update_client(_("Sending archive %s to %s"), pFilename, pURL); - string wholeURL = concat_path_file(pURL, strrchr(pFilename, '/') ? : pFilename); + char *whole_url = concat_path_file(pURL, strrchr(pFilename, '/') ? : pFilename); int count = m_nRetryCount; while (1) @@ -63,6 +63,7 @@ void CFileTransfer::SendFile(const char *pURL, const char *pFilename) FILE *f = fopen(pFilename, "r"); if (!f) { + free(whole_url); throw CABRTException(EXCEP_PLUGIN, "Can't open archive file '%s'", pFilename); } @@ -73,7 +74,7 @@ void CFileTransfer::SendFile(const char *pURL, const char *pFilename) /* enable uploading */ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); /* specify target */ - curl_easy_setopt(curl, CURLOPT_URL, wholeURL.c_str()); + curl_easy_setopt(curl, CURLOPT_URL, whole_url); /* FILE handle: passed to the default callback, it will fread() it */ curl_easy_setopt(curl, CURLOPT_READDATA, f); curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)buf.st_size); @@ -88,6 +89,7 @@ void CFileTransfer::SendFile(const char *pURL, const char *pFilename) /* retry the upload if not succesful, wait a bit before next try */ sleep(m_nRetryDelay); } + free(whole_url); } static void create_tar(const char *archive_name, const char *directory) |
