Commit 205659d
net: ipv4: fix a memleak in ip_setup_cork
[ Upstream commit 5dee6d6 ]
When inetdev_valid_mtu fails, cork->opt should be freed if it is
allocated in ip_setup_cork. Otherwise there could be a memleak.
Fixes: 501a90c ("inet: protect against too small mtu values.")
Signed-off-by: Zhipeng Lu <[email protected]>
Reviewed-by: Eric Dumazet <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>1 parent 38cc160 commit 205659d
1 file changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1287 | 1287 | | |
1288 | 1288 | | |
1289 | 1289 | | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
1290 | 1296 | | |
1291 | 1297 | | |
1292 | 1298 | | |
| |||
1303 | 1309 | | |
1304 | 1310 | | |
1305 | 1311 | | |
1306 | | - | |
1307 | | - | |
1308 | | - | |
1309 | | - | |
1310 | | - | |
1311 | | - | |
1312 | 1312 | | |
1313 | 1313 | | |
1314 | 1314 | | |
| |||
0 commit comments