From c2e14024a486f6cfcb8b50c37865f4c5c7724f45 Mon Sep 17 00:00:00 2001 From: dirk Date: Thu, 18 Dec 2014 20:37:29 +0000 Subject: [PATCH] Fixed usage of object after it has been destroyed and removed unused argument. --- MagickCore/distribute-cache.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/MagickCore/distribute-cache.c b/MagickCore/distribute-cache.c index 0cd1bf55b..521c393f8 100644 --- a/MagickCore/distribute-cache.c +++ b/MagickCore/distribute-cache.c @@ -323,12 +323,14 @@ MagickPrivate DistributeCacheInfo *AcquireDistributeCacheInfo( session_key=0; server_info->file=ConnectPixelCacheServer(hostname,server_info->port, &session_key,exception); - server_info->session_key=session_key; - (void) CopyMagickString(server_info->hostname,hostname,MaxTextExtent); - hostname=DestroyString(hostname); if (server_info->file == -1) server_info=DestroyDistributeCacheInfo(server_info); - server_info->debug=IsEventLogging(); + else + { + server_info->session_key=session_key; + (void) CopyMagickString(server_info->hostname,hostname,MaxTextExtent); + server_info->debug=IsEventLogging(); + } return(server_info); } @@ -395,12 +397,11 @@ MagickPrivate DistributeCacheInfo *DestroyDistributeCacheInfo( */ static MagickBooleanType DestroyDistributeCache(SplayTreeInfo *registry, - int magick_unused(file),const size_t session_key) + const size_t session_key) { /* Destroy distributed pixel cache. */ - magick_unreferenced(file); return(DeleteNodeFromSplayTree(registry,(const void *) session_key)); } @@ -839,7 +840,7 @@ static void *DistributePixelCacheClient(void *socket) } case 'd': { - status=DestroyDistributeCache(registry,client_socket,session_key); + status=DestroyDistributeCache(registry,session_key); break; } default: -- 2.40.0