Use vector<char> instead of char* and malloc() for images
And fix the associated memory leaks in the process.
Test: fastboot works
Change-Id: I6e41f351ca6cebf79282d30b1eca1506496e0c21
diff --git a/fastboot/engine.h b/fastboot/engine.h
index d78cb13..6b0bdca 100644
--- a/fastboot/engine.h
+++ b/fastboot/engine.h
@@ -48,7 +48,7 @@
void fb_reinit(Transport* transport);
bool fb_getvar(const std::string& key, std::string* value);
-void fb_flash(const std::string& partition, void* data, uint32_t sz);
+void fb_flash(const std::string& partition, const std::vector<char>& data);
void fb_flash_fd(const std::string& partition, int fd, uint32_t sz);
void fb_flash_sparse(const std::string& partition, struct sparse_file* s, uint32_t sz,
size_t current, size_t total);
@@ -59,7 +59,7 @@
void fb_query_save(const std::string& var, char* dest, uint32_t dest_size);
void fb_reboot();
void fb_command(const std::string& cmd, const std::string& msg);
-void fb_download(const std::string& name, void* data, uint32_t size);
+void fb_download(const std::string& name, const std::vector<char>& data);
void fb_download_fd(const std::string& name, int fd, uint32_t sz);
void fb_upload(const std::string& outfile);
void fb_notice(const std::string& notice);