.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * AppArmor security module |
---|
3 | 4 | * |
---|
.. | .. |
---|
5 | 6 | * |
---|
6 | 7 | * Copyright (C) 1998-2008 Novell/SUSE |
---|
7 | 8 | * Copyright 2009-2017 Canonical Ltd. |
---|
8 | | - * |
---|
9 | | - * This program is free software; you can redistribute it and/or |
---|
10 | | - * modify it under the terms of the GNU General Public License as |
---|
11 | | - * published by the Free Software Foundation, version 2 of the |
---|
12 | | - * License. |
---|
13 | 9 | * |
---|
14 | 10 | * AppArmor policy namespaces, allow for different sets of policies |
---|
15 | 11 | * to be loaded for tasks within the namespace. |
---|
.. | .. |
---|
125 | 121 | return ns; |
---|
126 | 122 | |
---|
127 | 123 | fail_unconfined: |
---|
128 | | - kzfree(ns->base.hname); |
---|
| 124 | + aa_policy_destroy(&ns->base); |
---|
129 | 125 | fail_ns: |
---|
130 | | - kzfree(ns); |
---|
| 126 | + kfree_sensitive(ns); |
---|
131 | 127 | return NULL; |
---|
132 | 128 | } |
---|
133 | 129 | |
---|
.. | .. |
---|
149 | 145 | |
---|
150 | 146 | ns->unconfined->ns = NULL; |
---|
151 | 147 | aa_free_profile(ns->unconfined); |
---|
152 | | - kzfree(ns); |
---|
| 148 | + kfree_sensitive(ns); |
---|
153 | 149 | } |
---|
154 | 150 | |
---|
155 | 151 | /** |
---|