diff options
author | Yang Tse <yangsita@gmail.com> | 2012-12-21 18:32:20 +0100 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2012-12-21 18:32:20 +0100 |
commit | c59c5e8ea28a3a8039fe5c35256d5fc2884bc5f9 (patch) | |
tree | 4ab07e0126e98317a16eb1b7ffdc17bb77f06a04 | |
parent | 0969045b6eda298c083ab8ee69c5d0dc5af203da (diff) |
lib543.c: OOM handling fixes
-rw-r--r-- | tests/libtest/lib543.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/libtest/lib543.c b/tests/libtest/lib543.c index 08d9c4544..b4a31ca9a 100644 --- a/tests/libtest/lib543.c +++ b/tests/libtest/lib543.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -45,9 +45,12 @@ int test(char *URL) s = curl_easy_escape(easy, (char*)a, asize); - printf("%s\n", s); + if(s) + printf("%s\n", s); + + if(s) + curl_free(s); - curl_free(s); curl_easy_cleanup(easy); return 0; |