From 9e86a38345ffff3bcaad061380c0cfa7191ac507 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Fri, 28 Dec 2012 05:28:37 +0000 Subject: [PATCH] #3833 'freespace' -- fix memset error. --- libtransmission/session.c | 11 ++++------- libtransmission/transmission.h | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/libtransmission/session.c b/libtransmission/session.c index 044307650..02ab12b78 100644 --- a/libtransmission/session.c +++ b/libtransmission/session.c @@ -590,8 +590,6 @@ tr_sessionInit (const char * tag, session->cache = tr_cacheNew (1024*1024*2); session->tag = tr_strdup (tag); session->magicNumber = SESSION_MAGIC_NUMBER; - session->downloadDirBlkDev = tr_malloc (TR_PATH_MAX + 1); - session->downloadDirFsType = tr_malloc (TR_PATH_MAX + 1); tr_bandwidthConstruct (&session->bandwidth, session, NULL); tr_peerIdInit (session->peer_id); tr_variantInitList (&session->removedTorrents, 0); @@ -969,12 +967,13 @@ tr_sessionGetDownloadDir (const tr_session * session) } int64_t -tr_sessionGetDownloadDirFreeSpace (const tr_session * session) +tr_sessionGetDownloadDirFreeSpace (tr_session * session) { assert (tr_isSession (session)); - return tr_getFreeSpace (session->downloadDir, session->downloadDirBlkDev, - session->downloadDirFsType); + return tr_getFreeSpace (session->downloadDir, + session->downloadDirBlkDev, + session->downloadDirFsType); } /*** @@ -1884,8 +1883,6 @@ tr_sessionClose (tr_session * session) tr_free (session->resumeDir); tr_free (session->torrentDir); tr_free (session->downloadDir); - tr_free (session->downloadDirBlkDev); - tr_free (session->downloadDirFsType); tr_free (session->incompleteDir); tr_free (session->blocklist_url); tr_free (session->peer_congestion_algorithm); diff --git a/libtransmission/transmission.h b/libtransmission/transmission.h index 8ab26dbca..d2f4ede4f 100644 --- a/libtransmission/transmission.h +++ b/libtransmission/transmission.h @@ -294,7 +294,7 @@ const char * tr_sessionGetDownloadDir (const tr_session * session); * @brief Get available disk space (in bytes) for the default download folder. * @return zero or positive integer on success, -1 in case of error. */ -int64_t tr_sessionGetDownloadDirFreeSpace (const tr_session * session); +int64_t tr_sessionGetDownloadDirFreeSpace (tr_session * session); /** * @brief Set the torrent's bandwidth priority. -- 2.40.0