Fix valgrind reported errors reading past the end of the buffer

git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3087 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2007-11-15 20:20:23 +00:00
parent da4f9c0df2
commit a2a2fa44fe

View File

@@ -128,7 +128,7 @@ nm_supplicant_config_add_option (NMSupplicantConfig *self,
return FALSE;
}
opt->value = g_malloc0 (sizeof (char) * len);
opt->value = g_malloc0 ((sizeof (char) * len) + 1);
if (opt->value == NULL) {
nm_debug ("Couldn't allocate memory for new config option value.");
g_slice_free (ConfigOption, opt);