Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F104194916
D30595.id90285.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D30595.id90285.diff
View Options
diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c
--- a/sys/netpfil/pf/pf_ioctl.c
+++ b/sys/netpfil/pf/pf_ioctl.c
@@ -2426,7 +2426,7 @@
ERROUT(ENOMEM);
/* Copy the request in */
- nvlpacked = malloc(nv->len, M_TEMP, M_WAITOK);
+ nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK);
if (nvlpacked == NULL)
ERROUT(ENOMEM);
@@ -2504,7 +2504,7 @@
ERROUT(EBUSY);
}
- free(nvlpacked, M_TEMP);
+ free(nvlpacked, M_NVLIST);
nvlpacked = nvlist_pack(nvl, &nv->len);
if (nvlpacked == NULL) {
PF_RULES_WUNLOCK();
@@ -2534,7 +2534,7 @@
#undef ERROUT
DIOCGETRULENV_error:
- free(nvlpacked, M_TEMP);
+ free(nvlpacked, M_NVLIST);
nvlist_destroy(nvrule);
nvlist_destroy(nvl);
@@ -4918,7 +4918,7 @@
if (nv->len > pf_ioctl_maxcount)
ERROUT(ENOMEM);
- nvlpacked = malloc(nv->len, M_TEMP, M_WAITOK);
+ nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK);
if (nvlpacked == NULL)
ERROUT(ENOMEM);
@@ -4936,7 +4936,7 @@
error = pf_killstates(&kill, &killed);
- free(nvlpacked, M_TEMP);
+ free(nvlpacked, M_NVLIST);
nvlpacked = NULL;
nvlist_destroy(nvl);
nvl = nvlist_create(0);
@@ -4958,7 +4958,7 @@
on_error:
nvlist_destroy(nvl);
- free(nvlpacked, M_TEMP);
+ free(nvlpacked, M_NVLIST);
return (error);
}
@@ -4976,7 +4976,7 @@
if (nv->len > pf_ioctl_maxcount)
ERROUT(ENOMEM);
- nvlpacked = malloc(nv->len, M_TEMP, M_WAITOK);
+ nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK);
if (nvlpacked == NULL)
ERROUT(ENOMEM);
@@ -4994,7 +4994,7 @@
killed = pf_clear_states(&kill);
- free(nvlpacked, M_TEMP);
+ free(nvlpacked, M_NVLIST);
nvlpacked = NULL;
nvlist_destroy(nvl);
nvl = nvlist_create(0);
@@ -5017,7 +5017,7 @@
#undef ERROUT
on_error:
nvlist_destroy(nvl);
- free(nvlpacked, M_TEMP);
+ free(nvlpacked, M_NVLIST);
return (error);
}
@@ -5035,7 +5035,7 @@
if (nv->len > pf_ioctl_maxcount)
ERROUT(ENOMEM);
- nvlpacked = malloc(nv->len, M_TEMP, M_WAITOK);
+ nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK);
if (nvlpacked == NULL)
ERROUT(ENOMEM);
@@ -5054,7 +5054,7 @@
if (s == NULL)
ERROUT(ENOENT);
- free(nvlpacked, M_TEMP);
+ free(nvlpacked, M_NVLIST);
nvlpacked = NULL;
nvlist_destroy(nvl);
nvl = nvlist_create(0);
@@ -5083,7 +5083,7 @@
errout:
if (s != NULL)
PF_STATE_UNLOCK(s);
- free(nvlpacked, M_TEMP);
+ free(nvlpacked, M_NVLIST);
nvlist_destroy(nvl);
return (error);
}
@@ -5125,6 +5125,7 @@
goto DIOCGETSTATESNV_full;
}
nvlist_append_nvlist_array(nvl, "states", nvls);
+ nvlist_destroy(nvls);
count++;
}
PF_HASHROW_UNLOCK(ih);
@@ -5151,7 +5152,7 @@
#undef ERROUT
errout:
- free(nvlpacked, M_TEMP);
+ free(nvlpacked, M_NVLIST);
nvlist_destroy(nvl);
return (error);
}
diff --git a/sys/netpfil/pf/pf_nv.c b/sys/netpfil/pf/pf_nv.c
--- a/sys/netpfil/pf/pf_nv.c
+++ b/sys/netpfil/pf/pf_nv.c
@@ -861,6 +861,7 @@
if (tmp == NULL)
goto errout;
nvlist_append_nvlist_array(nvl, "addr", tmp);
+ nvlist_destroy(tmp);
nvlist_append_number_array(nvl, "port", key->port[i]);
}
nvlist_add_number(nvl, "af", key->af);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 5, 2:31 PM (12 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15059519
Default Alt Text
D30595.id90285.diff (3 KB)
Attached To
Mode
D30595: pf: Fix more ioctl memory leaks
Attached
Detach File
Event Timeline
Log In to Comment