"ssn_range" needs to be a copy of "global_ssn_range", so that it's not

freed if "global_ssn_range" is changed because the preference was
changed.

svn path=/trunk/; revision=12322
This commit is contained in:
Guy Harris 2004-10-17 00:51:50 +00:00
parent 6d53294988
commit 01f041efc2
1 changed files with 1 additions and 4 deletions

View File

@ -600,13 +600,10 @@ prefs_register_range_preference(module_t *module, const char *name,
* have them be empty ranges) and freeable (as we free them
* if we change them).
*
* If the value is a null pointer, make it an empty range,
* otherwise make it a copy of the value.
* If the value is a null pointer, make it an empty range.
*/
if (*var == NULL)
*var = range_empty();
else
*var = range_copy(*var);
preference->varp.range = var;
preference->saved_val.range = NULL;
}