diff --git a/contrib/bsnmp/gensnmpdef/gensnmpdef.c b/contrib/bsnmp/gensnmpdef/gensnmpdef.c index ae34b7a44cf2..b0bfdafdd7be 100644 --- a/contrib/bsnmp/gensnmpdef/gensnmpdef.c +++ b/contrib/bsnmp/gensnmpdef/gensnmpdef.c @@ -560,6 +560,8 @@ main(int argc, char *argv[]) level = 0; last = NULL; for (opt = 0; opt < argc; opt++) { + if (mods[opt] == NULL) /* smiGetModule failed above */ + continue; n = smiGetFirstNode(mods[opt], SMI_NODEKIND_ANY); if (n == NULL) continue;