Преглед изворни кода

bugfix array mem allocation

Leon Urbas пре 11 година
родитељ
комит
e7ce756e49
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/opcua_basictypes.c

+ 1 - 1
src/opcua_basictypes.c

@@ -91,7 +91,7 @@ UA_Int32 UA_Array_new(void **p,UA_Int32 noElements, UA_Int32 type) {
 	// calculate the addresses to prevent memory segmentation. This would however not call
 	// init for each member
 	for(i=0; i<noElements; i++) {
-		retval |= UA_[type].new(p[i]);
+		retval |= UA_[type].new((void**)(*p + i * sizeof(void*)));
 	}
 	return retval;
 }