forked from TrueCloudLab/distribution
Fix the pointer initialization
If the overwriteStruct() finds an uninitialized pointer, it tries to initialize it, but does it incorrectly. It tries to assign a pointer to pointer, instead of pointer. Signed-off-by: Gladkov Alexey <agladkov@redhat.com>
This commit is contained in:
parent
e5b5e44386
commit
c9eba1a5bb
1 changed files with 1 additions and 1 deletions
|
@ -220,7 +220,7 @@ func (p *Parser) overwriteStruct(v reflect.Value, fullpath string, path []string
|
|||
}
|
||||
case reflect.Ptr:
|
||||
if field.IsNil() {
|
||||
field.Set(reflect.New(sf.Type))
|
||||
field.Set(reflect.New(field.Type().Elem()))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue