target: Fix possible memory leak in aptpl_metadata parsing
authorJoern Engel <joern@logfs.org>
Tue, 2 Sep 2014 21:49:56 +0000 (17:49 -0400)
committerNicholas Bellinger <nab@linux-iscsi.org>
Wed, 17 Sep 2014 21:16:54 +0000 (14:16 -0700)
Each case of match_strdup could leak memory if the same argument was
present before.  I am not too concerned, as it would require a
non-sensical combination like "target_lun=foo target_lun=bar", done
with root privileges and even then leak just a few bytes per instance.

But arg_p is different, as it will always leak memory.  Let's plug that
one.  And while at it, replace some &args[0] with args.

Found by coverity.

Signed-off-by: Joern Engel <joern@logfs.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>

No differences found