浏览代码

ncd: modules: arithmetic: fix crash on malloc failure

ambrop7 14 年之前
父节点
当前提交
ab13660e30
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      ncd/modules/arithmetic.c

+ 1 - 1
ncd/modules/arithmetic.c

@@ -171,7 +171,7 @@ static void new_templ (NCDModuleInst *i, compute_func cfunc)
 {
     struct instance *o = malloc(sizeof(*o));
     if (!o) {
-        ModuleLog(o->i, BLOG_ERROR, "wrong type");
+        ModuleLog(i, BLOG_ERROR, "malloc failed");
         goto fail0;
     }
     o->i = i;