Mercurial > dwindows
comparison gtk/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 |
comparison
equal
deleted
inserted
replaced
1885:0768bbcf67e5 | 1886:f7d408a47752 |
---|---|
2389 */ | 2389 */ |
2390 void *dw_dialog_wait(DWDialog *dialog) | 2390 void *dw_dialog_wait(DWDialog *dialog) |
2391 { | 2391 { |
2392 void *tmp; | 2392 void *tmp; |
2393 int newprocess = 0; | 2393 int newprocess = 0; |
2394 | |
2395 if(!dialog) | |
2396 return NULL; | |
2394 | 2397 |
2395 /* _dw_thread will be -1 if dw_main hasn't been run yet. */ | 2398 /* _dw_thread will be -1 if dw_main hasn't been run yet. */ |
2396 if(_dw_thread == (pthread_t)-1) | 2399 if(_dw_thread == (pthread_t)-1) |
2397 { | 2400 { |
2398 _dw_thread = pthread_self(); | 2401 _dw_thread = pthread_self(); |
9811 | 9814 |
9812 FD_SET(array[z].fd, &rd); | 9815 FD_SET(array[z].fd, &rd); |
9813 } | 9816 } |
9814 | 9817 |
9815 if(select(maxfd+1, &rd, NULL, NULL, NULL) == -1) | 9818 if(select(maxfd+1, &rd, NULL, NULL, NULL) == -1) |
9819 { | |
9820 free(array); | |
9816 return; | 9821 return; |
9822 } | |
9817 | 9823 |
9818 if(FD_ISSET(listenfd, &rd)) | 9824 if(FD_ISSET(listenfd, &rd)) |
9819 { | 9825 { |
9820 struct _seminfo *newarray; | 9826 struct _seminfo *newarray; |
9821 int newfd = accept(listenfd, 0, 0); | 9827 int newfd = accept(listenfd, 0, 0); |
9822 | 9828 |
9823 if(newfd > -1) | 9829 if(newfd > -1) |
9824 { | 9830 { |
9825 /* Add new connections to the set */ | 9831 /* Add new connections to the set */ |
9826 newarray = (struct _seminfo *)malloc(sizeof(struct _seminfo)*(connectcount+1)); | 9832 newarray = (struct _seminfo *)malloc(sizeof(struct _seminfo)*(connectcount+1)); |