summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclObjC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r--clang/lib/AST/DeclObjC.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index cda73d2ff9c..701ad353a3e 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/lib/AST/DeclObjC.cpp
@@ -260,14 +260,12 @@ void ObjCInterfaceDecl::mergeProperties(ObjCPropertyDecl **Properties,
// Add new properties to this buffer.
memcpy(buf+NumPropertyDecl, Properties,
NumNewProperties*sizeof(ObjCPropertyDecl*));
- free(PropertyDecl);
+ delete[] PropertyDecl;
PropertyDecl = newPropertyDecl;
NumPropertyDecl += NumNewProperties;
}
else {
- PropertyDecl = new ObjCPropertyDecl*[NumNewProperties];
- memcpy(PropertyDecl, Properties, NumNewProperties*sizeof(ObjCPropertyDecl*));
- NumPropertyDecl = NumNewProperties;
+ addProperties(Properties, NumNewProperties);
}
}
OpenPOWER on IntegriCloud