Zero out cb structs completely.
This commit is contained in:
parent
ab17573692
commit
196b26035a
@ -55,7 +55,7 @@ xbps_set_cb_fetch(off_t file_size,
|
|||||||
if (xhp->fetch_cb == NULL)
|
if (xhp->fetch_cb == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
xfcd = malloc(sizeof(*xfcd));
|
xfcd = calloc(1, sizeof(*xfcd));
|
||||||
if (xfcd == NULL)
|
if (xfcd == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ xbps_set_cb_state(xbps_state_t state,
|
|||||||
if (xhp->state_cb == NULL)
|
if (xhp->state_cb == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
xscd = malloc(sizeof(*xscd));
|
xscd = calloc(1, sizeof(*xscd));
|
||||||
if (xscd == NULL)
|
if (xscd == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ xbps_set_cb_state(xbps_state_t state,
|
|||||||
va_start(va, fmt);
|
va_start(va, fmt);
|
||||||
retval = vasprintf(&buf, fmt, va);
|
retval = vasprintf(&buf, fmt, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
if (retval == -1)
|
if (retval <= 0)
|
||||||
xscd->desc = NULL;
|
xscd->desc = NULL;
|
||||||
else
|
else
|
||||||
xscd->desc = buf;
|
xscd->desc = buf;
|
||||||
@ -125,7 +125,7 @@ xbps_set_cb_unpack(const char *entry,
|
|||||||
if (xhp->unpack_cb == NULL)
|
if (xhp->unpack_cb == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
xucd = malloc(sizeof(*xucd));
|
xucd = calloc(1, sizeof(*xucd));
|
||||||
if (xucd == NULL)
|
if (xucd == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user