Update of /cvsroot/njbfs/njbfs
In directory usw-pr-cvs1:/tmp/cvs-serv30325
Modified Files:
njbfs_cache.c njbfs_dir.c
Log Message:
Ben: fix memory issues/ leaks
Index: njbfs_cache.c
===================================================================
RCS file: /cvsroot/njbfs/njbfs/njbfs_cache.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** njbfs_cache.c 24 Feb 2002 00:15:13 -0000 1.1
--- njbfs_cache.c 26 Feb 2002 02:11:47 -0000 1.2
***************
*** 552,561 ****
while(fattr_list) {
fattr = fattr_list->fattr;
- kfree(fattr->fname);
- kfree(fattr->codec);
- kfree(fattr->title);
- kfree(fattr->artist);
- kfree(fattr->album);
- kfree(fattr->genre);
track_destroy(fattr->track);
--- 552,555 ----
***************
*** 724,738 ****
while (frame != NULL) {
if (!strcmp(FR_ARTIST, frame->label)) {
! SAFE_STRDUP_NULL(fattr->artist, (char *) frame->data);
} else if (!strcmp(FR_FNAME, frame->label)) {
! SAFE_STRDUP_NULL(fattr->fname, (char *) frame->data);
} else if (!strcmp(FR_TITLE, frame->label)) {
! SAFE_STRDUP_NULL(fattr->title, (char *) frame->data);
} else if (!strcmp(FR_CODEC, frame->label)) {
! SAFE_STRDUP_NULL(fattr->codec, (char *) frame->data);
} else if (!strcmp(FR_ALBUM, frame->label)) {
! SAFE_STRDUP_NULL(fattr->album, (char *) frame->data);
} else if (!strcmp(FR_GENRE, frame->label)) {
! SAFE_STRDUP_NULL(fattr->genre, (char *) frame->data);
} else if (!strcmp(FR_SIZE, frame->label)) {
fattr->size = get_track_size(frame);
--- 718,732 ----
while (frame != NULL) {
if (!strcmp(FR_ARTIST, frame->label)) {
! fattr->artist = frame->data;
} else if (!strcmp(FR_FNAME, frame->label)) {
! fattr->fname = frame->data;
} else if (!strcmp(FR_TITLE, frame->label)) {
! fattr->title = frame->data;
} else if (!strcmp(FR_CODEC, frame->label)) {
! fattr->codec = frame->data;
} else if (!strcmp(FR_ALBUM, frame->label)) {
! fattr->album = frame->data;
} else if (!strcmp(FR_GENRE, frame->label)) {
! fattr->genre = frame->data;
} else if (!strcmp(FR_SIZE, frame->label)) {
fattr->size = get_track_size(frame);
Index: njbfs_dir.c
===================================================================
RCS file: /cvsroot/njbfs/njbfs/njbfs_dir.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** njbfs_dir.c 24 Feb 2002 00:15:13 -0000 1.1
--- njbfs_dir.c 26 Feb 2002 02:11:47 -0000 1.2
***************
*** 178,181 ****
--- 178,186 ----
p->entry.atime = CURRENT_TIME;
+ kfree(album);
+ kfree(artist);
+ kfree(title);
+ kfree(codec);
+
return 0;
}
|