Avoid memory leak when failing to read file metadata
authorTobias Brunner <tobias@strongswan.org>
Fri, 28 Sep 2012 15:10:19 +0000 (17:10 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 28 Sep 2012 15:10:19 +0000 (17:10 +0200)
src/libpts/pts/pts.c

index e8dfe5b..4c6c5bc 100644 (file)
@@ -504,6 +504,7 @@ static bool file_metadata(char *pathname, pts_file_metadata_t **entry)
        if (stat(pathname, &st))
        {
                DBG1(DBG_PTS, "unable to obtain statistics about '%s'", pathname);
+               free(this);
                return FALSE;
        }