Fix for the issue found by address sanitizer.

=== modified file 'parser/libapparmor_re/expr-tree.h'
--- parser/libapparmor_re/expr-tree.h   2016-01-19 23:07:04 +0000
+++ parser/libapparmor_re/expr-tree.h   2017-03-21 15:33:53 +0000
@@ -663,25 +663,25 @@
        hashedNodeVec(NodeSet *n, unsigned long h): hash(h)
        {
                len = n->size();
                nodes = new ImportantNode *[n->size()];
                ImportantNode **j = nodes;
                for (NodeSet::iterator i = n->begin(); i != n->end(); i++) {
                        *(j++) = *i;
                }
        }
 
        ~hashedNodeVec()
        {
-               delete nodes;
+               delete [] nodes;
        }
 
        unsigned long size()const { return len; }
 
        bool operator<(hashedNodeVec const &rhs)const
        {
                if (hash == rhs.hash) {
                        if (len == rhs.size()) {
                                for (unsigned int i = 0; i < len; i++) {
                                        if (nodes[i] != rhs.nodes[i])
                                                return nodes[i] < rhs.nodes[i];
                                }

Thanks,
Oleg

-- 
AppArmor mailing list
AppArmor@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor

Reply via email to