comparison dbutil.c @ 615:e3ac0a426bd0

Fix FD leak if connect() fails, found by Klocwork
author Matt Johnston <matt@ucc.asn.au>
date Thu, 07 Apr 2011 13:05:10 +0000
parents 00eca37e47e8
children 7cc34a52feb8
comparison
equal deleted inserted replaced
614:00eca37e47e8 615:e3ac0a426bd0
309 TRACE(("Failed to open unix socket")) 309 TRACE(("Failed to open unix socket"))
310 return -1; 310 return -1;
311 } 311 }
312 if (connect(fd, (struct sockaddr*)&addr, sizeof(addr)) < 0) { 312 if (connect(fd, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
313 TRACE(("Failed to connect to '%s' socket", path)) 313 TRACE(("Failed to connect to '%s' socket", path))
314 m_close(fd);
314 return -1; 315 return -1;
315 } 316 }
316 return fd; 317 return fd;
317 } 318 }
318 #endif 319 #endif