From: Yuan Fu Date: Tue, 18 Oct 2022 00:13:25 +0000 (-0700) Subject: Change malloc to xmalloc in treesit.c X-Git-Tag: emacs-29.0.90~1816 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ddae8d4a13d58720a3118355fabc225a9d907160;p=emacs.git Change malloc to xmalloc in treesit.c * src/treesit.c (Ftreesit_parser_set_included_ranges): Change malloc to xmalloc. --- diff --git a/src/treesit.c b/src/treesit.c index 60280e02898..5994f6c263d 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -1335,8 +1335,7 @@ is nil, the PARSER is to parse the whole buffer. */) if (list_length (ranges) > UINT32_MAX) xsignal (Qargs_out_of_range, list2 (ranges, Flength (ranges))); uint32_t len = (uint32_t) list_length (ranges); - /* FIXME: We should test the return value of malloc below. */ - TSRange *treesit_ranges = malloc (sizeof(TSRange) * len); + TSRange *treesit_ranges = xmalloc (sizeof(TSRange) * len); struct buffer *buffer = XBUFFER (XTS_PARSER (parser)->buffer); for (int idx = 0; !NILP (ranges); idx++, ranges = XCDR (ranges))