diff options
author | Luis Machado <lgustavo@codesourcery.com> | 2013-11-27 10:39:26 -0200 |
---|---|---|
committer | Luis Machado <lgustavo@codesourcery.com> | 2013-11-27 10:39:26 -0200 |
commit | 0db4ca1856d6131e726434ff67cbe42a5e1f81d1 (patch) | |
tree | 584a25e62d26fe7a2a9fb97be38eb40c04c0563b /gdb/testsuite/gdb.base/setvar.c | |
parent | 48d5accb7a8b0b5195628b05e1f1dbf0c9cc4a22 (diff) | |
download | gdb-0db4ca1856d6131e726434ff67cbe42a5e1f81d1.zip gdb-0db4ca1856d6131e726434ff67cbe42a5e1f81d1.tar.gz gdb-0db4ca1856d6131e726434ff67cbe42a5e1f81d1.tar.bz2 |
* gdb.base/callfuncs.c (main): Assign malloc's return value
and free it afterwards.
* gdb.base/charset-malloc.c (malloc_stub): Likewise.
* gdb.base/printcmds.c (main): Likewise.
* gdb.base/randomize.c (main): Free "p" and change breakpoint
marker position.
* gdb.base/setvar.c (dummy): Assign malloc's return value
and free it afterwards.
Diffstat (limited to 'gdb/testsuite/gdb.base/setvar.c')
-rw-r--r-- | gdb/testsuite/gdb.base/setvar.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.base/setvar.c b/gdb/testsuite/gdb.base/setvar.c index 3a80b22..5d08602 100644 --- a/gdb/testsuite/gdb.base/setvar.c +++ b/gdb/testsuite/gdb.base/setvar.c @@ -204,7 +204,7 @@ dummy () { /* setvar.exp wants to allocate memory for constants. So make sure malloc gets linked into the program. */ - malloc (1); + void *p = malloc (1); /* Some linkers (e.g. on AIX) remove unreferenced variables, so make sure to reference them. */ @@ -278,4 +278,5 @@ dummy () sef.field = s1; uef.field = u1; #endif + free (p); } |