From: Robert W. <ro...@us...> - 2006-01-09 16:49:03
|
Update of /cvsroot/ltp/ltp/testcases/kernel/io/ltp-aiodio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7193 Modified Files: fsx-linux.c Log Message: Applied memory leak fix. Index: fsx-linux.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/io/ltp-aiodio/fsx-linux.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** fsx-linux.c 25 Feb 2004 23:47:05 -0000 1.1 --- fsx-linux.c 9 Jan 2006 16:48:50 -0000 1.2 *************** *** 1189,1197 **** --- 1189,1201 ---- original_buf[i] = random() % 256; good_buf = (char *) malloc(maxfilelen + writebdy); + char *good_buf_old = good_buf; good_buf = round_up(good_buf, writebdy, 0); + bzero(good_buf, maxfilelen); temp_buf = (char *) malloc(maxoplen + readbdy); + char * temp_buf_old = temp_buf; temp_buf = round_up(temp_buf, readbdy, 0); bzero(temp_buf, maxoplen); + if (lite) { /* zero entire existing file */ ssize_t written; *************** *** 1212,1222 **** check_trunc_hack(); while (numops == -1 || numops--) test(); ! if (close(fd)) { prterr("close"); report_failure(99); } prt("All operations completed A-OK!\n"); --- 1216,1234 ---- check_trunc_hack(); + while (numops == -1 || numops--) test(); ! if (close(fd)) { prterr("close"); report_failure(99); } + + + free(original_buf); + free(good_buf_old); + free(temp_buf_old); + + prt("All operations completed A-OK!\n"); *************** *** 1224,1225 **** --- 1236,1239 ---- return 0; } + + |