Commit 0b58bc98 authored by jan.koester's avatar jan.koester
Browse files

fixed leaks

parent 86563d9e
Loading
Loading
Loading
Loading
Loading
+3 −3
Changes for src/authdb.h: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -59,11 +59,11 @@ namespace authdb {
        struct Record {
            char   start = 0xFE;
            uuid_t uuid;
            int    type;
            int    storage;
            int    type = 0;
            int    storage = 0;
            char   fieldname[255];
            size_t datasize = 0;
            char  *data;
            char  *data = nullptr;
            size_t count = 0;
        } *Data;

+2 −2
Changes for src/group.h: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -46,8 +46,8 @@ namespace authdb {
        const char *getName();

        struct MemberUids {
            size_t  count;
            uuid_t *uid;
            size_t  count=0;
            uuid_t *uid=nullptr;
        };

        void addMember(const MemberUids &uid);
+4 −2
Changes for src/session.cpp: 4 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -252,6 +252,8 @@ void authdb::Session::relSession(AuthBackend &backend,uuid_t sessionid){
        }
    }

    delete[] grpdat.gid;

    grpdat.gid = new uuid_t[grpdat.count];

    size_t count=0;
@@ -275,13 +277,13 @@ void authdb::Session::relSession(AuthBackend &backend,uuid_t sessionid){
                uuid_copy(grpdat.gid[count++],cur.uuid);
        }
    }
    delete[] cursess->_member.gid;

    if(grpdat.count<__UINTMAX_MAX__){
        cursess->_member.gid=new uuid_t[grpdat.count];
        for(size_t i=0; i<grpdat.count; ++i)
            uuid_copy(cursess->_member.gid[i],grpdat.gid[i]);
        cursess->_member.count=grpdat.count;

    }
}