]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/distribute-cache.c
The 8bim profile will be updated when the iptc profile is changed.
[imagemagick] / MagickCore / distribute-cache.c
index 6a072380c50981519bfd31570fd7de66c867eef0..36a0ac44454da74327cb7b265b2ab43964a462ab 100644 (file)
@@ -207,6 +207,7 @@ static int ConnectPixelCacheServer(const char *hostname,const int port,
     result->ai_protocol);
   if (client_socket == -1)
     {
+      (void) close(client_socket);
       (void) ThrowMagickException(exception,GetMagickModule(),CacheError,
         "DistributedPixelCache","'%s'",hostname);
       return(-1);
@@ -909,11 +910,14 @@ MagickExport void DistributePixelCacheServer(const int port,
     status=setsockopt(server_socket,SOL_SOCKET,SO_REUSEADDR,&one,(socklen_t)
       sizeof(one));
     if (status == -1)
-      continue;
+      {
+        (void) close(server_socket);
+        continue;
+      }
     status=bind(server_socket,p->ai_addr,p->ai_addrlen);
     if (status == -1)
       {
-        (void) close(status);
+        (void) close(server_socket);
         continue;
       }
     break;