diff --git a/GetRuntimeAddresses/symbolyze/gdb_test.go b/GetRuntimeAddresses/symbolyze/gdb_test.go index 720403f..c76951d 100644 --- a/GetRuntimeAddresses/symbolyze/gdb_test.go +++ b/GetRuntimeAddresses/symbolyze/gdb_test.go @@ -103,6 +103,8 @@ func extractOffsetWithGdb(pid int, t *testing.T) (offset uint64, err error) { return 0, err } + defer cmd.Wait() + scanner := bufio.NewScanner(output) for scanner.Scan() { 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") }