[PATCH] D31983: Free zone name when destroying malloc zone

Francis Ricci via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 13 07:11:58 PDT 2017


fjricci added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_malloc_mac.inc:62
   }
+  if (zone->zone_name) {
+    COMMON_MALLOC_FREE((void *)zone->zone_name);
----------------
alekseyshl wrote:
> fjricci wrote:
> > alekseyshl wrote:
> > > Nit: prefer no brackets for one liners
> > Even for macros?
> Ha, you're right, COMMON_MALLOC_FREE is . I was assuming multiline macro supposed to do this "do {} while (0)" trick. Anyway, ignore this nit.
Yeah, it may be worth looking into fixing up our macros to use do/while in the future.


https://reviews.llvm.org/D31983





More information about the llvm-commits mailing list