Fix wrongly closing file descripter for disk when failing to add
disk. To avoid this, memset it with 0 at initialization.
Also check if sd->sd_list[0] is NULL before freeing it since it could
be NULL if failing in the middle of adding disk.
Signed-off-by: HATAYAMA Daisuke <d.hatayama(a)jp.fujitsu.com>
---
sadump.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)