call defer cmd.Wait() before return
This commit is contained in:
parent
4ba4442100
commit
3c7f976acc
@ -103,6 +103,8 @@ func extractOffsetWithGdb(pid int, t *testing.T) (offset uint64, err error) {
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defer cmd.Wait()
|
||||||
|
|
||||||
scanner := bufio.NewScanner(output)
|
scanner := bufio.NewScanner(output)
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
line := scanner.Text()
|
line := scanner.Text()
|
||||||
@ -113,9 +115,5 @@ func extractOffsetWithGdb(pid int, t *testing.T) (offset uint64, err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cmd.Wait(); err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0, fmt.Errorf("Symbol not found with gdb")
|
return 0, fmt.Errorf("Symbol not found with gdb")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user