handle-as-empty-document shouldn't be dependent on the image blocking
[privoxy.git] / filters.c
index 993444c..219c581 100644 (file)
--- a/filters.c
+++ b/filters.c
@@ -1,4 +1,4 @@
-const char filters_rcs[] = "$Id: filters.c,v 1.122 2009/06/08 16:48:09 fabiankeil Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.124 2009/08/19 15:24:30 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/filters.c,v $
@@ -419,14 +419,15 @@ int acl_addr(const char *aspec, struct access_control_addr *aca)
    hints.ai_socktype = SOCK_STREAM;
 
    i = getaddrinfo(acl_spec, ((p) ? ++p : NULL), &hints, &result);
-   freez(acl_spec);
 
    if (i != 0)
    {
       log_error(LOG_LEVEL_ERROR, "Can not resolve [%s]:%s: %s",
          acl_spec, p, gai_strerror(i));
+      freez(acl_spec);
       return(-1);
    }
+   freez(acl_spec);
 
    /* TODO: Allow multihomed hostnames */
    memcpy(&(aca->addr), result->ai_addr, result->ai_addrlen);
@@ -688,7 +689,9 @@ struct http_response *block_url(struct client_state *csp)
       }
 #endif /* Preceeding code is disabled for now */
    }
-   else if(csp->action->flags & ACTION_HANDLE_AS_EMPTY_DOCUMENT)
+   else
+#endif /* def FEATURE_IMAGE_BLOCKING */
+   if(csp->action->flags & ACTION_HANDLE_AS_EMPTY_DOCUMENT)
    {
      /*
       *  Send empty document.               
@@ -716,7 +719,6 @@ struct http_response *block_url(struct client_state *csp)
       }
    }
    else
-#endif /* def FEATURE_IMAGE_BLOCKING */
 
    /*
     * Else, generate an HTML "blocked" message: