repo.or.cz
/
libc-test.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
functional: add mntent test
[libc-test.git]
/
src
/
regression
/
putenv-doublefree.c
blob
d57bba1e787a1ebb1705022fbad60a2b770e1eb5
1
// commit 9543656cc32fda48fc463f332ee20e91eed2b768 2016-03-06
2
// __putenv could be confused into freeing storage that does not belong to the implementation
3
#define _XOPEN_SOURCE 700
4
#include <stdlib.h>
5
#include <string.h>
6
7
int
main
(
void
)
8
{
9
setenv
(
"A"
,
"1"
,
1
);
10
setenv
(
"A"
,
"2"
,
1
);
11
char
*
c
=
strdup
(
"A=3"
);
12
putenv
(
c
);
13
setenv
(
"A"
,
"4"
,
1
);
14
free
(
c
);
15
return
0
;
16
}