OSDN Git Service

[COVERITY] Fix memory leak in libss (ss_execute_line)
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 21 Mar 2007 21:34:47 +0000 (17:34 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 21 Mar 2007 21:34:47 +0000 (17:34 -0400)
commitf19c46dfbcffd6d494a6df057bc602515a39246e
tree7843e04ecfba708cd699d042c3b8999e4f59c67f
parentf1d6a0797b13c1b1c364ab4ee9b500e5455aeeeb
[COVERITY] Fix memory leak in libss (ss_execute_line)

Fix a memory leak by freeing the argv[] array if ss_parse_line returns 0
for argc 0 (which will happen if the user his return and sends an empty
line to the application).

Potentially need to free argv before early return since it was allocated
memory. Need to be careful since it may be possible for ss_parse() to have
freed the memory allocated to it if it detects an unbalanced set of quotes
passed to it.

Coverity ID: 21: Resource Leak

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
lib/ss/ChangeLog
lib/ss/execute_cmd.c