On 10/06/2014 11:13 PM, Ulrich Windl wrote:
Andy Grover <[email protected]> schrieb am 06.10.2014 um 18:36 in Nachricht
<[email protected]>:
Signed-off-by: Andy Grover <[email protected]>
---
  usr/iscsiadm.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
index f886d39..0cdc1bb 100644
--- a/usr/iscsiadm.c
+++ b/usr/iscsiadm.c
...
@@ -2251,8 +2251,7 @@ static int exec_host_stats_op(int op, int info_level,
uint32_t host_no)
        ipc->ctldev_close();

  exit_host_stats:
-       if (req_buf)
-               free(req_buf);
+       free(req_buf);
        return rc;
  }

Are you sure it's always safe to free(NULL)? I know systems where you get a 
core dump (SIGSEGV)...

Regards,
Ulrich

Are they Linux systems? The man page for free(3) on my box says if ptr is NULL, no operation is performed.

Regards -- Andy

--
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to