Fix couple of leaks

maxim432 created

Change summary

src/main/java/eu/siacs/conversations/persistance/FileBackend.java        | 4 
src/main/java/eu/siacs/conversations/services/XmppConnectionService.java | 1 
2 files changed, 4 insertions(+), 1 deletion(-)

Detailed changes

src/main/java/eu/siacs/conversations/persistance/FileBackend.java 🔗

@@ -1295,7 +1295,9 @@ public class FileBackend {
     private int calcSampleSize(Uri image, int size) throws FileNotFoundException, SecurityException {
         BitmapFactory.Options options = new BitmapFactory.Options();
         options.inJustDecodeBounds = true;
-        BitmapFactory.decodeStream(mXmppConnectionService.getContentResolver().openInputStream(image), null, options);
+        InputStream inputStream = mXmppConnectionService.getContentResolver().openInputStream(image);
+        BitmapFactory.decodeStream(inputStream, null, options);
+        close(inputStream);
         return calcSampleSize(options, size);
     }