diff gtk3/dw.c @ 1886:f7d408a47752

Fix a couple of errors reported by the static analyzer on Mac.... Also added similar fixes to the other platforms as well just in case.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 05 Sep 2013 17:58:40 +0000
parents 71780cf68aa2
children 09860ba329a4
line wrap: on
line diff
--- a/gtk3/dw.c	Fri Aug 30 00:07:22 2013 +0000
+++ b/gtk3/dw.c	Thu Sep 05 17:58:40 2013 +0000
@@ -2058,6 +2058,9 @@
    void *tmp;
    int newprocess = 0;
 
+   if(!dialog)
+      return NULL;
+
    /* _dw_thread will be -1 if dw_main hasn't been run yet. */
    if(_dw_thread == (pthread_t)-1)
    {
@@ -8032,12 +8035,15 @@
       }
 
       if(select(maxfd+1, &rd, NULL, NULL, NULL) == -1)
+      {
+         free(array);
          return;
+      }
 
       if(FD_ISSET(listenfd, &rd))
       {
          struct _seminfo *newarray;
-            int newfd = accept(listenfd, 0, 0);
+         int newfd = accept(listenfd, 0, 0);
 
          if(newfd > -1)
          {