* 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.
This commit is contained in:
Luis Machado 2013-11-27 10:39:26 -02:00
parent 48d5accb7a
commit 0db4ca1856
6 changed files with 21 additions and 5 deletions

View file

@ -1,3 +1,14 @@
2013-11-26 Luis Machado <lgustavo@codesourcery.com>
* 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.
2013-11-26 Andrew Burgess <aburgess@broadcom.com> 2013-11-26 Andrew Burgess <aburgess@broadcom.com>
* gdb.base/setshow.exp: Add $gdb_prompt to the patterns in * gdb.base/setshow.exp: Add $gdb_prompt to the patterns in

View file

@ -652,9 +652,10 @@ voidfunc (void)
int main () int main ()
{ {
malloc(1); void *p = malloc (1);
t_double_values(double_val1, double_val2); t_double_values(double_val1, double_val2);
t_structs_c(struct_val1); t_structs_c(struct_val1);
free (p);
return 0 ; return 0 ;
} }

View file

@ -31,5 +31,6 @@ malloc_stub (void)
{ {
/* charset.exp wants to allocate memory for constants. So make sure malloc /* charset.exp wants to allocate memory for constants. So make sure malloc
gets linked into the program. */ gets linked into the program. */
malloc (1); void *p = malloc (1);
free (p);
} }

View file

@ -218,10 +218,11 @@ char invalid_RRR[] = "aaaaaaaaaaaaaaaaaaaa"
int main () int main ()
{ {
malloc(1); void *p = malloc (1);
/* Prevent AIX linker from removing variables. */ /* Prevent AIX linker from removing variables. */
return ctable1[0] + ctable2[0] + int1dim[0] + int2dim[0][0] return ctable1[0] + ctable2[0] + int1dim[0] + int2dim[0][0]
+ int3dim[0][0][0] + int4dim[0][0][0][0] + teststring[0] + + int3dim[0][0][0] + int4dim[0][0][0][0] + teststring[0] +
*parrays -> array1 + a1[0] + a2[0]; *parrays -> array1 + a1[0] + a2[0];
free (p);
} }

View file

@ -24,5 +24,6 @@ int main()
p = malloc (1); p = malloc (1);
return 0; /* print p */ free (p); /* print p */
return 0;
} }

View file

@ -204,7 +204,7 @@ dummy ()
{ {
/* setvar.exp wants to allocate memory for constants. So make sure malloc /* setvar.exp wants to allocate memory for constants. So make sure malloc
gets linked into the program. */ gets linked into the program. */
malloc (1); void *p = malloc (1);
/* Some linkers (e.g. on AIX) remove unreferenced variables, /* Some linkers (e.g. on AIX) remove unreferenced variables,
so make sure to reference them. */ so make sure to reference them. */
@ -278,4 +278,5 @@ dummy ()
sef.field = s1; sef.field = s1;
uef.field = u1; uef.field = u1;
#endif #endif
free (p);
} }