aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2014-09-10 18:30:29 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2015-12-17 15:24:37 +0200
commit8b906710fc1ddd9483c8a7c062f4ac87cd31a05b (patch)
tree7ddc3df5c285ac45b7da41555a4ba5d9ea098591
parentcf3ef4e4933d3882557377e43897d807056cafc4 (diff)
downloadgrecs-8b906710fc1ddd9483c8a7c062f4ac87cd31a05b.tar.gz
grecs-8b906710fc1ddd9483c8a7c062f4ac87cd31a05b.tar.bz2
Minor change
* tests/wsp.c (main): use additional variable to keep the allocated value in incremental mode.
-rw-r--r--tests/wsp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/wsp.c b/tests/wsp.c
index 3e82e9a..de90c54 100644
--- a/tests/wsp.c
+++ b/tests/wsp.c
@@ -184,7 +184,7 @@ wsp_getvar (const char *vptr, size_t vlen, void *data)
int
main (int argc, char **argv)
{
- char buf[1024], *ptr;
+ char buf[1024], *ptr, *saved_ptr;
int i, offarg = 0;
int trimnl_option = 0;
int plaintext_option = 0;
@@ -366,13 +366,13 @@ main (int argc, char **argv)
if (*ptr == 0)
ptr = NULL;
else
- free ((void*)ws.ws_input);
+ free (saved_ptr);
}
else
next_call = 1;
if (ptr)
{
- ptr = strdup (ptr);
+ ptr = saved_ptr = strdup (ptr);
assert (ptr != NULL);
}
}

Return to:

Send suggestions and report system problems to the System administrator.