summaryrefslogtreecommitdiff
path: root/plugins/vtx
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-11-11 20:55:09 +0100
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-11-11 21:30:40 +0100
commitdfacef3019e560159601c80745f2b88919f65d27 (patch)
tree14fd54c01bf3ba26076c71f3ca09e6f77bbdc5fb /plugins/vtx
parent679daf9907e3ae8bba66fe8a2e5f57a2987130f4 (diff)
fixed few errors reported by cppcheck (thanks to Pavel Roschin)
Diffstat (limited to 'plugins/vtx')
-rw-r--r--plugins/vtx/vtxfile.c15
1 files changed, 9 insertions, 6 deletions
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);
+ }
}