diff --git a/src/Image.cc b/src/Image.cc index 06dd564ae..d40e92145 100644 --- a/src/Image.cc +++ b/src/Image.cc @@ -1408,6 +1408,7 @@ Image::rotatePixels(uint8_t* pixels, int width, int height, int channels, std::memcpy(pixels + new_idx, unrotated + orig_idx, channels); } } + delete[] unrotated; }; auto rotate270 = [](uint8_t* pixels, int width, int height, int channels) { @@ -1424,6 +1425,7 @@ Image::rotatePixels(uint8_t* pixels, int width, int height, int channels, std::memcpy(pixels + new_idx, unrotated + orig_idx, channels); } } + delete[] unrotated; }; switch (orientation) {