Adding early nil return in config_item (when value is empty).

This commit is contained in:
NiR- 2014-06-06 10:31:39 +02:00
parent 755609c059
commit 2b9f45f8a5
2 changed files with 23 additions and 0 deletions

View file

@ -1238,6 +1238,9 @@ container_config_item(VALUE self, VALUE rb_key)
if (len1 < 0)
rb_raise(Error, "invalid configuration key: %s", key);
if (len1 == 0)
return Qnil;
value = malloc(sizeof(char) * len1 + 1);
if (value == NULL)
rb_raise(rb_eNoMemError, "unable to allocate configuration value");