Hi,
I ran Coverity analysis tool on alsa and found some bugs. Bug and Patch description
1. Changed file : aserver.c Socket not closed before returning when bind fails Community Code:
if (bind(sock, (struct sockaddr *) addr, size) < 0) { int result = -errno; SYSERROR("bind failed"); return result; } return sock; }
Recommended Code :
if (bind(sock, (struct sockaddr *) addr, size) < 0) { int result = -errno; SYSERROR("bind failed"); close(sock); return result; } return sock; }
2.Changed file : control_shm.c Socket not closed before returning when connect fails
Community Code: if (connect(sock, (struct sockaddr *) addr, size) < 0) return -errno; return sock; }
Recommended Code : if (connect(sock, (struct sockaddr *) addr, size) < 0){ SYSERR("connect failed"); close(sock); return -errno; } return sock; }
3.Changed file : pcm_shm.c Socket not closed before returning when connect fails
Community Code: if (connect(sock, (struct sockaddr *) addr, size) < 0) { SYSERR("connect failed"); return -errno; } return sock; } Recommended Code : if (connect(sock, (struct sockaddr *) addr, size) < 0) { SYSERR("connect failed"); close(sock); return -errno; } return sock; }
PFA patch.
Thanks & Regards,
Renu Tyagi