Ticket #9909: 0020-Fix-memory-leak.patch

File 0020-Fix-memory-leak.patch, 951 bytes (added by mt, 11 years ago)

Patch

  • src/system/kernel/fs/vfs.cpp

    From 48ee20d3df41afd9f3102bcc880b4ae0d4849559 Mon Sep 17 00:00:00 2001
    From: Murai Takashi <tmurai01@gmail.com>
    Date: Thu, 1 Aug 2013 20:36:56 +0900
    Subject: [PATCH] Fix memory leak
    
    ---
     src/system/kernel/fs/vfs.cpp |    3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp
    index 114d6ab..47e682b 100644
    a b put_mount(struct fs_mount* mount)  
    723723    could not open the module.
    724724*/
    725725static file_system_module_info*
    726 get_file_system(const char* fsName)
     726get_file_system(char* fsName)
    727727{
    728728    char name[B_FILE_NAME_LENGTH];
    729729    if (strncmp(fsName, "file_systems/", strlen("file_systems/"))) {
    730730        // construct module name if we didn't get one
    731731        // (we currently support only one API)
    732732        snprintf(name, sizeof(name), "file_systems/%s/v1", fsName);
     733        free(fsName);
    733734        fsName = NULL;
    734735    }
    735736