From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1i9mLu-0006WF-SQ for barebox@lists.infradead.org; Mon, 16 Sep 2019 08:27:20 +0000 From: =?UTF-8?q?Ulrich=20=C3=96lmann?= Date: Mon, 16 Sep 2019 10:27:01 +0200 Message-Id: <20190916082701.27350-1-u.oelmann@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH] imd: fix memory leak To: Barebox List RWFjaCBpbnZvY2F0aW9uIG9mICdpbWQnIGF0ZSB1cCB0byAxTUIgb2YgUkFNLgoKU2lnbmVkLW9m Zi1ieTogVWxyaWNoIMOWbG1hbm4gPHUub2VsbWFubkBwZW5ndXRyb25peC5kZT4KLS0tCiBjb21t b24vaW1kLmMgfCAyMCArKysrKysrKysrKysrKy0tLS0tLQogMSBmaWxlIGNoYW5nZWQsIDE0IGlu c2VydGlvbnMoKyksIDYgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvY29tbW9uL2ltZC5jIGIv Y29tbW9uL2ltZC5jCmluZGV4IDA1ZTExOGU3NzM2MS4uOTEzYTAxZGU4N2JmIDEwMDY0NAotLS0g YS9jb21tb24vaW1kLmMKKysrIGIvY29tbW9uL2ltZC5jCkBAIC0zMzcsOCArMzM3LDEwIEBAIGlu dCBpbWRfY29tbWFuZChpbnQgYXJnYywgY2hhciAqYXJndltdKQogCQlyZXR1cm4gLWVycm5vOwog CiAJaW1kX3N0YXJ0ID0gaW1kX2dldChidWYsIHNpemUpOwotCWlmIChJU19FUlIoaW1kX3N0YXJ0 KSkKLQkJcmV0dXJuIFBUUl9FUlIo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