From dfacef3019e560159601c80745f2b88919f65d27 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Mon, 11 Nov 2013 20:55:09 +0100 Subject: fixed few errors reported by cppcheck (thanks to Pavel Roschin) --- plugins/vtx/vtxfile.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'plugins/vtx') diff --git a/plugins/vtx/vtxfile.c b/plugins/vtx/vtxfile.c index 9dbeb9f7..ff9914e6 100644 --- a/plugins/vtx/vtxfile.c +++ b/plugins/vtx/vtxfile.c @@ -192,12 +192,15 @@ void ayemu_vtx_free(ayemu_vtx_t *vtx) { #define FREE_PTR(x) if (x) { free(x); x = NULL; } - FREE_PTR(vtx->title); - FREE_PTR(vtx->author); - FREE_PTR(vtx->from); - FREE_PTR(vtx->tracker); - FREE_PTR(vtx->comment); - FREE_PTR(vtx->regdata); + if (vtx) { + FREE_PTR(vtx->title); + FREE_PTR(vtx->author); + FREE_PTR(vtx->from); + FREE_PTR(vtx->tracker); + FREE_PTR(vtx->comment); + FREE_PTR(vtx->regdata); + free (vtx); + } } -- cgit v1.2.3