From ea2710bca47414673fec86f35d7ef9427a4f9dee Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 25 Sep 2012 01:06:13 +0200 Subject: [PATCH] xbps-uhelper: allways zero out xbps_handle passed to xbps_{init,end}. (cherry picked from commit e84d44a3416936333d10b134514eca6abddb5d6d) --- bin/xbps-uhelper/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/xbps-uhelper/main.c b/bin/xbps-uhelper/main.c index 2c310d38..bfb7db58 100644 --- a/bin/xbps-uhelper/main.c +++ b/bin/xbps-uhelper/main.c @@ -147,6 +147,8 @@ main(int argc, char **argv) if (argc < 1) usage(); + memset(&xh, 0, sizeof(xh)); + if ((strcasecmp(argv[0], "register") == 0) || (strcasecmp(argv[0], "unregister") == 0) || (strcasecmp(argv[0], "version") == 0) || @@ -155,7 +157,6 @@ main(int argc, char **argv) /* * Initialize libxbps. */ - memset(&xh, 0, sizeof(xh)); xh.flags = flags; xh.fetch_cb = fetch_file_progress_cb; xh.fetch_cb_data = &xfer;