From 5e1f20c4d2d80692caffdec819f87e8ca5f257d1 Mon Sep 17 00:00:00 2001 From: Magnus Melin Date: Mon, 19 Nov 2018 21:55:32 +0200 Subject: [PATCH] Bug 1507907 - null check result of CFDateFormatterCreate. r=gandalf --- intl/locale/mac/OSPreferences_mac.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/intl/locale/mac/OSPreferences_mac.cpp b/intl/locale/mac/OSPreferences_mac.cpp index aef29ab886eae..9510fb6a5b99f 100644 --- a/intl/locale/mac/OSPreferences_mac.cpp +++ b/intl/locale/mac/OSPreferences_mac.cpp @@ -160,6 +160,9 @@ OSPreferences::ReadDateTimePattern(DateTimeFormatStyle aDateStyle, CFDateFormatterCreate(kCFAllocatorDefault, locale, ToCFDateFormatterStyle(aDateStyle), ToCFDateFormatterStyle(aTimeStyle)); + if (!formatter) { + return false; + } CFStringRef format = CFDateFormatterGetFormat(formatter); CFRelease(locale);