From fac249d6727fb1ee2404ffc94d9e032cec450454 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Fri, 3 Aug 2018 13:52:28 -0400 Subject: [PATCH] 2018-08-03 Fred Gleason * Fixed a regression in 'RDAudioExport' that caused a segfault. --- ChangeLog | 2 ++ lib/rdaudioexport.cpp | 8 ++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9544924a..95968c7d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17314,3 +17314,5 @@ 2018-08-03 Fred Gleason * Fixed bugs in CDDB lookup code that caused corruption when processing UTF-8 strings. +2018-08-03 Fred Gleason + * Fixed a regression in 'RDAudioExport' that caused a segfault. diff --git a/lib/rdaudioexport.cpp b/lib/rdaudioexport.cpp index 6f9e7b43..273a8586 100644 --- a/lib/rdaudioexport.cpp +++ b/lib/rdaudioexport.cpp @@ -201,6 +201,7 @@ RDAudioExport::ErrorCode RDAudioExport::runExport(const QString &username, } if((f=fopen(conv_dst_filename,"w"))==NULL) { curl_easy_cleanup(curl); + curl_formfree(first); return RDAudioExport::ErrorNoDestination; } // @@ -212,8 +213,6 @@ RDAudioExport::ErrorCode RDAudioExport::runExport(const QString &username, curl_easy_setopt(curl,CURLOPT_URL,url); curl_easy_setopt(curl,CURLOPT_HTTPPOST,first); curl_easy_setopt(curl,CURLOPT_WRITEDATA,f); - // curl_easy_setopt(curl,CURLOPT_POST,1); - // curl_easy_setopt(curl,CURLOPT_POSTFIELDS,(const char *)post); curl_easy_setopt(curl,CURLOPT_USERAGENT, (const char *)rda->config()->userAgent()); curl_easy_setopt(curl,CURLOPT_TIMEOUT,RD_CURL_TIMEOUT); @@ -255,12 +254,11 @@ RDAudioExport::ErrorCode RDAudioExport::runExport(const QString &username, } curl_easy_getinfo(curl,CURLINFO_RESPONSE_CODE,&response_code); curl_easy_cleanup(curl); + curl_formfree(first); fclose(f); if(response_code==200) { *conv_err=RDAudioConvert::ErrorOk; - curl_easy_cleanup(curl); - curl_formfree(first); return RDAudioExport::ErrorOk; } @@ -280,8 +278,6 @@ RDAudioExport::ErrorCode RDAudioExport::runExport(const QString &username, default: ret=RDAudioExport::ErrorConverter; } - curl_easy_cleanup(curl); - curl_formfree(first); unlink(conv_dst_filename); return ret;