Date: Tue, 03 Sep 2019 14:06:29 -0000 From: Toomas Soome <tsoome@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345999 - head/stand/common Message-ID: <201904071150.x37BogKs084727@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tsoome Date: Sun Apr 7 11:50:41 2019 New Revision: 345999 URL: https://svnweb.freebsd.org/changeset/base/345999 Log: loader: file_addmodule should check for memory allocation strdup() can return NULL. MFC after: 1w Modified: head/stand/common/module.c Modified: head/stand/common/module.c ============================================================================== --- head/stand/common/module.c Sun Apr 7 11:48:41 2019 (r345998) +++ head/stand/common/module.c Sun Apr 7 11:50:41 2019 (r345999) @@ -930,6 +930,10 @@ file_addmodule(struct preloaded_file *fp, char *modnam if (mp == NULL) return (ENOMEM); mp->m_name = strdup(modname); + if (mp->m_name == NULL) { + free(mp); + return (ENOMEM); + } mp->m_version = version; mp->m_fp = fp; mp->m_next = fp->f_modules;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904071150.x37BogKs084727>