staging: dgap: fix memory leak in dgap_parsefile()
authorRonit Halder <ronit.crj@gmail.com>
Wed, 30 Sep 2015 06:09:45 +0000 (11:39 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Sep 2015 10:26:20 +0000 (12:26 +0200)
commit5b62408ffe42ffce28e94bc5e7a6dec45e6456ee
tree784812a62a502d33f0cdba13368839ea667b068e
parent4221c5958796174a5ea13043075816b199a60d09
staging: dgap: fix memory leak in dgap_parsefile()

In dgap_parsefile() char pointers are set with kstrdup()
without checking that some string is allocated to that
char pointer before. This patch frees the memory if already allocated
and then set the poniter with kstrdup().

Signed-off-by: Ronit halder <ronit.crj@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgap/dgap.c