From 34d88dda42c1297567f34f334156786ba9a28898 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Tue, 30 Jun 2015 14:13:24 +0200 Subject: [PATCH] Don't access freed memory The fields array contains pointers into the value_copy string. --- src/virt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/virt.c b/src/virt.c index 69a46071..663555b9 100644 --- a/src/virt.c +++ b/src/virt.c @@ -417,8 +417,8 @@ lv_config (const char *key, const char *value) else if (strcasecmp (fields[i], "uuid") == 0) hostname_format[i] = hf_uuid; else { - sfree (value_copy); ERROR (PLUGIN_NAME " plugin: unknown HostnameFormat field: %s", fields[i]); + sfree (value_copy); return -1; } } @@ -454,8 +454,8 @@ lv_config (const char *key, const char *value) else if (strcasecmp (fields[i], "uuid") == 0) plugin_instance_format[i] = plginst_uuid; else { - sfree (value_copy); ERROR (PLUGIN_NAME " plugin: unknown PluginInstanceFormat field: %s", fields[i]); + sfree (value_copy); return -1; } } -- 2.30.2