]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tty/lib_twait.c
ncurses 6.0 - patch 20151017
[ncurses.git] / ncurses / tty / lib_twait.c
index e912a6389abc5d3957229d3c561a53a29b5630ae..15d07c3e4e81c80edce11a35db01020927af9bed 100644 (file)
@@ -75,7 +75,7 @@
 #endif
 #undef CUR
 
-MODULE_ID("$Id: lib_twait.c,v 1.69 2015/05/02 22:23:16 tom Exp $")
+MODULE_ID("$Id: lib_twait.c,v 1.70 2015/07/04 21:01:02 tom Exp $")
 
 static long
 _nc_gettime(TimeType * t0, int first)
@@ -230,7 +230,8 @@ _nc_timed_wait(SCREEN *sp MAYBE_UNUSED,
 
 #ifdef NCURSES_WGETCH_EVENTS
     if ((mode & TW_EVENT) && evl) {
-       fds = typeMalloc(struct pollfd, MIN_FDS + evl->count);
+       if (fds == fd_list)
+           fds = typeMalloc(struct pollfd, MIN_FDS + evl->count);
        if (fds == 0)
            return TW_NONE;
     }