diff --git a/avprobe.c b/avprobe.c
index a3c1f809528533938c786e6cca5f5e29aeec744b..0233ea9e39a344c20e46b83bbe26b54ccefa3085 100644
--- a/avprobe.c
+++ b/avprobe.c
@@ -491,6 +491,9 @@ int main(int argc, char **argv)
 
     ret = probe_file(input_filename);
 
+    uninit_opts();
+    av_dict_free(&fmt_entries_to_show);
+
     avformat_network_deinit();
 
     return ret;