Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/sesutil/sesutil.c
Show First 20 Lines • Show All 478 Lines • ▼ Show 20 Lines | for (j = 0; j < nobj; j++) { | ||||
(caddr_t) &e_status) < 0) { | (caddr_t) &e_status) < 0) { | ||||
close(fd); | close(fd); | ||||
xo_err(EXIT_FAILURE, "ENCIOC_GETELMSTAT"); | xo_err(EXIT_FAILURE, "ENCIOC_GETELMSTAT"); | ||||
} | } | ||||
/* Get the description of the element */ | /* Get the description of the element */ | ||||
memset(&e_desc, 0, sizeof(e_desc)); | memset(&e_desc, 0, sizeof(e_desc)); | ||||
e_desc.elm_idx = e_ptr[j].elm_idx; | e_desc.elm_idx = e_ptr[j].elm_idx; | ||||
e_desc.elm_desc_len = UINT16_MAX; | e_desc.elm_desc_len = UINT16_MAX; | ||||
/* XXX memory leak! */ | |||||
e_desc.elm_desc_str = calloc(UINT16_MAX, sizeof(char)); | e_desc.elm_desc_str = calloc(UINT16_MAX, sizeof(char)); | ||||
if (e_desc.elm_desc_str == NULL) { | if (e_desc.elm_desc_str == NULL) { | ||||
close(fd); | close(fd); | ||||
xo_err(EXIT_FAILURE, "calloc()"); | xo_err(EXIT_FAILURE, "calloc()"); | ||||
} | } | ||||
if (ioctl(fd, ENCIOC_GETELMDESC, | if (ioctl(fd, ENCIOC_GETELMDESC, | ||||
(caddr_t) &e_desc) < 0) { | (caddr_t) &e_desc) < 0) { | ||||
close(fd); | close(fd); | ||||
▲ Show 20 Lines • Show All 515 Lines • Show Last 20 Lines |