From 17b37ea3faa29bfae884907c0894c4d5e7588299 Mon Sep 17 00:00:00 2001 From: Xiaochen Shen Date: Wed, 24 Apr 2019 16:41:51 +0800 Subject: [PATCH] libcontainer: intelrdt: add missing destroy handler in defer func In the exception handling of initProcess.start(), we need to add the missing IntelRdtManager.Destroy() handler in defer func. Signed-off-by: Xiaochen Shen --- libcontainer/process_linux.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libcontainer/process_linux.go b/libcontainer/process_linux.go index 6507f0e6..ff8bde03 100644 --- a/libcontainer/process_linux.go +++ b/libcontainer/process_linux.go @@ -337,6 +337,9 @@ func (p *initProcess) start() error { if err != nil { // TODO: should not be the responsibility to call here p.manager.Destroy() + if p.intelRdtManager != nil { + p.intelRdtManager.Destroy() + } } }() if err := p.createNetworkInterfaces(); err != nil {