summaryrefslogtreecommitdiff
path: root/test/parse-auto.c
diff options
context:
space:
mode:
authorAnthony J. Bentley <anthony@cathet.us>2013-04-26 19:01:28 -0600
committerVincent Sanders <vincent.sanders@collabora.co.uk>2013-04-27 08:26:54 +0100
commit652ef30ea4e99e7ae38277304a53ee82e458eb28 (patch)
tree4655ff9e97ec0ed3df36a902cf1b7ab411c978b8 /test/parse-auto.c
parent79645bfda9c6fd8a7580d527f290cf440e7796f0 (diff)
downloadlibcss-652ef30ea4e99e7ae38277304a53ee82e458eb28.tar.gz
libcss-652ef30ea4e99e7ae38277304a53ee82e458eb28.tar.bz2
Don't use the nonportable alloca() during tests.
Diffstat (limited to 'test/parse-auto.c')
-rw-r--r--test/parse-auto.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/parse-auto.c b/test/parse-auto.c
index 156c38d..0549f45 100644
--- a/test/parse-auto.c
+++ b/test/parse-auto.c
@@ -409,7 +409,7 @@ void run_test(const uint8_t *data, size_t len, exp_entry *exp, size_t explen)
if (error == CSS_OK) {
css_stylesheet *import;
- char *buf = alloca(lwc_string_length(url) + 1);
+ char *buf = malloc(lwc_string_length(url) + 1);
memcpy(buf, lwc_string_data(url),
lwc_string_length(url));
@@ -425,6 +425,8 @@ void run_test(const uint8_t *data, size_t len, exp_entry *exp, size_t explen)
error = CSS_IMPORTS_PENDING;
lwc_string_unref(url);
+
+ free(buf);
}
}