Commit 3265949
apparmor: Fix memleak issue in unpack_profile()
Before aa_alloc_profile(), it has allocated string for @*ns_name if @tmpns
is not NULL, so directly return -ENOMEM if aa_alloc_profile() failed will
cause a memleak issue, and even if aa_alloc_profile() succeed, in the
@fail_profile tag of aa_unpack(), it need to free @ns_name as well, this
patch fixes them.
Fixes: 736ec75 ("AppArmor: policy routines for loading and unpacking policy")
Fixes: 04dc715 ("apparmor: audit policy ns specified in policy load")
Signed-off-by: Xiu Jianfeng <[email protected]>
Signed-off-by: John Johansen <[email protected]>1 parent 7dd426e commit 3265949
1 file changed
+12
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
858 | 858 | | |
859 | 859 | | |
860 | 860 | | |
861 | | - | |
862 | | - | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
863 | 866 | | |
864 | 867 | | |
865 | 868 | | |
| |||
1090 | 1093 | | |
1091 | 1094 | | |
1092 | 1095 | | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
1093 | 1100 | | |
1094 | 1101 | | |
1095 | 1102 | | |
| |||
1392 | 1399 | | |
1393 | 1400 | | |
1394 | 1401 | | |
| 1402 | + | |
1395 | 1403 | | |
1396 | 1404 | | |
1397 | 1405 | | |
| |||
1401 | 1409 | | |
1402 | 1410 | | |
1403 | 1411 | | |
1404 | | - | |
1405 | 1412 | | |
1406 | 1413 | | |
1407 | 1414 | | |
| |||
1432 | 1439 | | |
1433 | 1440 | | |
1434 | 1441 | | |
| 1442 | + | |
1435 | 1443 | | |
1436 | 1444 | | |
1437 | 1445 | | |
| |||
1452 | 1460 | | |
1453 | 1461 | | |
1454 | 1462 | | |
| 1463 | + | |
1455 | 1464 | | |
1456 | 1465 | | |
1457 | 1466 | | |
| |||
0 commit comments