Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Rich Salz <rsalz@openssl.org>
-static APP_INFO *pop_info(void)
+/* returns 1 if there was an info to pop, 0 if the stack was empty. */
+static int pop_info(void)
+ APP_INFO *current = NULL;
if (amih != NULL) {
CRYPTO_THREADID_current(&tmp.threadid);
if (amih != NULL) {
CRYPTO_THREADID_current(&tmp.threadid);
- if ((ret = lh_APP_INFO_delete(amih, &tmp)) != NULL) {
- APP_INFO *next = ret->next;
+ if ((current = lh_APP_INFO_delete(amih, &tmp)) != NULL) {
+ APP_INFO *next = current->next;
if (next != NULL) {
next->references++;
(void)lh_APP_INFO_insert(amih, next);
}
if (next != NULL) {
next->references++;
(void)lh_APP_INFO_insert(amih, next);
}
- if (--(ret->references) <= 0) {
- ret->next = NULL;
+ if (--(current->references) <= 0) {
+ current->next = NULL;
if (next != NULL)
next->references--;
if (next != NULL)
next->references--;
}
int CRYPTO_mem_debug_push(const char *info, const char *file, int line)
}
int CRYPTO_mem_debug_push(const char *info, const char *file, int line)
if (mem_check_on()) {
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
if (mem_check_on()) {
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
- ret = (pop_info() != NULL);
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
}
return (ret);
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
}
return (ret);