This shouldn't break anything, things were already broken.
-/* Library which manipulates firewall rules. Version $Revision: 1.36 $ */
+/* Library which manipulates firewall rules. Version $Revision: 1.37 $ */
/* Architecture of firewall rules is as follows:
*
iptc_fn = TC_INIT;
- if (sockfd != -1)
+ if (sockfd != -1) {
close(sockfd);
+ sockfd = -1;
+ }
if (strlen(tablename) >= TABLE_MAXNAMELEN) {
errno = EINVAL;
if ((h = alloc_handle(info.name, info.size, info.num_entries))
== NULL) {
close(sockfd);
+ sockfd = -1;
return NULL;
}
if (getsockopt(sockfd, TC_IPPROTO, SO_GET_ENTRIES, &h->entries,
&tmp) < 0) {
close(sockfd);
+ sockfd = -1;
free(h);
return NULL;
}
TC_FREE(TC_HANDLE_T *h)
{
close(sockfd);
+ sockfd = -1;
if ((*h)->cache_chain_heads)
free((*h)->cache_chain_heads);
free(*h);