diff --git a/IO_EXIOExpander.h b/IO_EXIOExpander.h index ca67319..5e7a1e9 100644 --- a/IO_EXIOExpander.h +++ b/IO_EXIOExpander.h @@ -105,8 +105,8 @@ private: if (_digitalPinBytes < digitalBytesNeeded) { // Not enough space, free any existing buffer and allocate a new one if (_digitalPinBytes > 0) free(_digitalInputStates); - _digitalInputStates = (byte*) calloc(_digitalPinBytes, 1); _digitalPinBytes = digitalBytesNeeded; + _digitalInputStates = (byte*) calloc(_digitalPinBytes, 1); } }