diff options
author | Jesper Juhl <jj@chaosbits.net> | 2011-08-02 10:26:36 +0200 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-08-22 19:26:16 +0000 |
commit | 9be08c5804ae4ad96ec22d0b1e71e630803a85ea (patch) | |
tree | c49610a94f3441db14a384ee2c8d533707781e9c /drivers/target/iscsi/iscsi_target_parameters.h | |
parent | e1750ba20f0d850c38820190ccbf0f647723091a (diff) |
iscsi-target: Fix leak on failure in iscsi_copy_param_list()
We leak memory if the allocations for 'new_param->name' or
'new_param->value' fail in iscsi_target_parameters.c::iscsi_copy_param_list()
We also do a lot of variable assignments that are completely pointless
if the allocations fail.
So, let's move the allocations before the assignments and also make
sure that we free whatever was allocated to one if the allocation fail.
There's also some small CodingStyle fixups in there (curly braces on
both branches of if statement, only one variable per line) since I was
in the area anyway. And finally, error messages in the function are
put on a single line for easy grep'abillity.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/iscsi/iscsi_target_parameters.h')
0 files changed, 0 insertions, 0 deletions