Explorar o código

ncd: modules: arithmetic: fix crash on malloc failure

ambrop7 %!s(int64=14) %!d(string=hai) anos
pai
achega
ab13660e30
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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;