summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorManuel Argüelles <manuel.arguelles@gmail.com>2013-08-14 10:40:26 -0500
committerManuel Argüelles <manuel.arguelles@gmail.com>2013-08-14 10:40:26 -0500
commit2196fb8bc8117af1536db43cba5823f355077da9 (patch)
tree3d179891a027e1fb5a956e55313896779c5b676f /testing
parenta3d3d37c23f8070fad5933543f3c4a3d0d57f390 (diff)
Fix segfault when using -f in toxic
Call strdup() to the data file argument string to avoid segmentation fault when it is later freed.
Diffstat (limited to 'testing')
-rw-r--r--testing/toxic/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/testing/toxic/main.c b/testing/toxic/main.c
index 063c1483..ec33c72f 100644
--- a/testing/toxic/main.c
+++ b/testing/toxic/main.c
@@ -218,7 +218,7 @@ int main(int argc, char *argv[])
218 else if (argv[i][0] == '-') { 218 else if (argv[i][0] == '-') {
219 if (argv[i][1] == 'f') { 219 if (argv[i][1] == 'f') {
220 if (argv[i + 1] != NULL) 220 if (argv[i + 1] != NULL)
221 DATA_FILE = argv[i + 1]; 221 DATA_FILE = strdup(argv[i + 1]);
222 else 222 else
223 f_flag = -1; 223 f_flag = -1;
224 } else if (argv[i][1] == 'n') { 224 } else if (argv[i][1] == 'n') {