mirror of
https://github.com/containers/podman.git
synced 2025-07-02 08:47:43 +08:00
api: Error checking before NULL dereference
Move error checking of possible null returned value before its dereference in importBuilder.Format Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Tigran Sogomonian <tsogomonian@astralinux.ru>
This commit is contained in:
@ -72,10 +72,10 @@ func (c *Container) Commit(ctx context.Context, destImage string, options Contai
|
||||
OverrideConfig: options.CommitOptions.OverrideConfig,
|
||||
}
|
||||
importBuilder, err := buildah.ImportBuilder(ctx, c.runtime.store, builderOptions)
|
||||
importBuilder.Format = options.PreferredManifestType
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
importBuilder.Format = options.PreferredManifestType
|
||||
if options.Author != "" {
|
||||
importBuilder.SetMaintainer(options.Author)
|
||||
}
|
||||
|
Reference in New Issue
Block a user