libsdhcdrivers: Free allocated memory If no callback is given, command must be destroyed prior to returning from the function.
diff --git a/libsdhcdrivers/src/mmc.c b/libsdhcdrivers/src/mmc.c index 2b1a4a6..85810a5 100644 --- a/libsdhcdrivers/src/mmc.c +++ b/libsdhcdrivers/src/mmc.c
@@ -477,6 +477,7 @@ } else { unsigned long ret; ret = host_send_command(mmc_card, cmd, NULL, NULL); + mmc_cmd_destroy(cmd); return (ret) ? ret : bs * nblocks; } }