aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/AST/DeclObjC.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp
index cda73d2ff9..701ad353a3 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/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);
}
}