summaryrefslogtreecommitdiffstatshomepage
path: root/py/lexerstr.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-10-09 16:53:37 +0100
committerDamien George <damien.p.george@gmail.com>2014-10-09 16:53:37 +0100
commit9bf5f2857d2015e3d440feb03c102ed9730c8f4d (patch)
tree2791cbe24eb236443216962ef7b3456dc7eeb892 /py/lexerstr.c
parenta8202762f0092896c45378cea95076780b2c0aae (diff)
downloadmicropython-9bf5f2857d2015e3d440feb03c102ed9730c8f4d.tar.gz
micropython-9bf5f2857d2015e3d440feb03c102ed9730c8f4d.zip
py: Add further checks for failed malloc in lexer init functions.
Diffstat (limited to 'py/lexerstr.c')
-rw-r--r--py/lexerstr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/lexerstr.c b/py/lexerstr.c
index 3a68441107..a1f7ce41d0 100644
--- a/py/lexerstr.c
+++ b/py/lexerstr.c
@@ -52,7 +52,7 @@ STATIC void str_buf_free(mp_lexer_str_buf_t *sb) {
}
mp_lexer_t *mp_lexer_new_from_str_len(qstr src_name, const char *str, mp_uint_t len, mp_uint_t free_len) {
- mp_lexer_str_buf_t *sb = m_new_maybe(mp_lexer_str_buf_t, 1);
+ mp_lexer_str_buf_t *sb = m_new_obj_maybe(mp_lexer_str_buf_t);
if (sb == NULL) {
return NULL;
}