svn commit: r345999 - head/stand/common
Toomas Soome
tsoome at FreeBSD.org
Sun Apr 7 11:50:42 UTC 2019
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;
More information about the svn-src-all
mailing list