--- libcdaudio-0.99.6/source/cddb.c.orig 2002-12-16 23:18:40.000000000 +0100 +++ libcdaudio-0.99.6/source/cddb.c 2002-12-16 23:20:38.000000000 +0100 @@ -840,7 +840,7 @@ inbuffer[index] = inchar; } - fprintf(stdout, "%*s\n", index, index, inbuffer); + fprintf(stdout, "%*s\n", index, inbuffer); return index; } @@ -916,7 +916,7 @@ free(outbuffer); if(mode == CDDB_MODE_HTTP) - cddb_skip_http_header(sock); + if (cddb_skip_http_header(sock)<0) return -1; if((inbuffer = malloc(256)) == NULL) return -1; @@ -1160,11 +1160,15 @@ cddb_genre(entry->entry_genre), entry->entry_id); - send(sock, outbuffer, strlen(outbuffer), 0); + if(send(sock, outbuffer, strlen(outbuffer), 0)<0) { + free(outbuffer); + return -1; + } + free(outbuffer); if(mode == CDDB_MODE_HTTP) - cddb_skip_http_header(sock); + if (cddb_skip_http_header(sock)<0) return -1; if(cddb_read_token(sock, token) < 0) return -1;