summaryrefslogtreecommitdiff
path: root/testapp.c
diff options
context:
space:
mode:
authorminkikim89 <minkikim89@gmail.com>2019-08-20 00:40:45 +0900
committerdormando <dormando@rydia.net>2019-08-27 17:44:38 -0700
commit17354ac36e37cf7f8423ee4a4b82e09d00121a7e (patch)
tree4b4a834001dcaee458f718ac1f5f52219b8d0120 /testapp.c
parent1ab043b7c73b473261bb8f223c85ecc188a56a51 (diff)
downloadmemcached-17354ac36e37cf7f8423ee4a4b82e09d00121a7e.tar.gz
add error handling when calling dup function
Diffstat (limited to 'testapp.c')
-rw-r--r--testapp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/testapp.c b/testapp.c
index 755df27..6735a85 100644
--- a/testapp.c
+++ b/testapp.c
@@ -589,6 +589,7 @@ static struct conn *connect_server(const char *hostname, in_port_t port,
static enum test_return test_vperror(void) {
int rv = 0;
int oldstderr = dup(STDERR_FILENO);
+ assert(oldstderr >= 0);
char tmpl[sizeof(TMP_TEMPLATE)+1];
strncpy(tmpl, TMP_TEMPLATE, sizeof(TMP_TEMPLATE)+1);