# HG changeset patch # User ib # Date 1398343177 0 # Node ID 393b5e0d5f288e3155452f52d08c5be8c97b45a6 # Parent 004f226b4e4ba1a740fae2dfc68e69a5138cea07 Rewrite add_vf(). Move variable to scope where it is used. Additionally, rename it. diff -r 004f226b4e4b -r 393b5e0d5f28 gui/interface.c --- a/gui/interface.c Thu Apr 24 12:29:30 2014 +0000 +++ b/gui/interface.c Thu Apr 24 12:39:37 2014 +0000 @@ -277,8 +277,6 @@ static void add_vf(const char *vf) { - void *p; - if (vf_settings) { int i = 0; @@ -290,12 +288,12 @@ } if (i != -1) { - p = realloc(vf_settings, (i + 2) * sizeof(m_obj_settings_t)); + void *settings = realloc(vf_settings, (i + 2) * sizeof(m_obj_settings_t)); - if (!p) + if (!settings) return; - vf_settings = p; + vf_settings = settings; vf_settings[i].name = strdup(vf); vf_settings[i].attribs = NULL; vf_settings[i + 1].name = NULL;