Jelajahi Sumber

ncd: modules: arithmetic: fix crash on malloc failure

ambrop7 14 tahun lalu
induk
melakukan
ab13660e30
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  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;