Running valgrind on our data analysis application while accessing xrootd found some problems in the error handling in XrdClient and a few minor nits in XrdOuc. This message contains the suggested patches to XrdOuc/XrdOucPthread.cc. The next email will contain a raft of patches for XrdClient. One thing that troubles me is that by using valgrind, the protocol fails completely, apparently because of timing issues. Connections get torn down while we are in the poll call, waiting for a response from the xrootd server. My best guess is that this is either a bug in the protocol or a timeout issue. (My second-best guess is that valgrind is broken, but since it works well enough most of the time, I lean more towards my best guess.)