Adding early nil return in config_item (when value is empty).
This commit is contained in:
parent
755609c059
commit
2b9f45f8a5
2 changed files with 23 additions and 0 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue