Skip to content

Commit

Permalink
Fix a small mem leak in the test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed Dec 11, 2021
1 parent f52d724 commit 0fea3b6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/api/similar_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ VImage SimilarImage::normalize(const VImage &image) const {
}

std::string SimilarImage::dhash(const VImage &image) const {
auto thumbnail_options = VImage::option()
vips::VOption *thumbnail_options = VImage::option()
->set("height", 8)
->set("size", VIPS_SIZE_FORCE)
->set("no_rotate", true)
Expand Down Expand Up @@ -90,6 +90,8 @@ std::string SimilarImage::dhash(const VImage &image) const {
}
}

g_free(dhash_image);

std::ostringstream ss;
ss << std::hex << std::noshowbase << std::setw(16) << std::setfill('0')
<< hash;
Expand Down

0 comments on commit 0fea3b6

Please sign in to comment.