Skip to content

Commit

Permalink
issue #1 add missing efree() call
Browse files Browse the repository at this point in the history
  • Loading branch information
gregor-j committed Oct 9, 2018
1 parent 4ec7d70 commit 0d74441
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pam.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ PHP_FUNCTION(pam_auth) {
spprintf(&error_msg, 0, "%s (in %s)", (char *) pam_strerror(pamh, result), "pam_start");
zval_dtor(status);
ZVAL_STRING(status, error_msg);
efree(error_msg);
}
RETURN_FALSE;
}
Expand All @@ -275,6 +276,7 @@ PHP_FUNCTION(pam_auth) {
spprintf(&error_msg, 0, "%s (in %s)", (char *) pam_strerror(pamh, result), "pam_authenticate");
zval_dtor(status);
ZVAL_STRING(status, error_msg);
efree(error_msg);
}
pam_end(pamh, PAM_SUCCESS);
RETURN_FALSE;
Expand All @@ -286,6 +288,7 @@ PHP_FUNCTION(pam_auth) {
spprintf(&error_msg, 0, "%s (in %s)", (char *) pam_strerror(pamh, result), "pam_acct_mgmt");
zval_dtor(status);
ZVAL_STRING(status, error_msg);
efree(error_msg);
}
pam_end(pamh, PAM_SUCCESS);
RETURN_FALSE;
Expand Down Expand Up @@ -327,6 +330,7 @@ PHP_FUNCTION(pam_chpass) {
spprintf(&error_msg, 0, "%s (in %s)", (char *) pam_strerror(pamh, result), "pam_start");
zval_dtor(status);
ZVAL_STRING(status, error_msg);
efree(error_msg);
}
RETURN_FALSE;
}
Expand All @@ -336,6 +340,7 @@ PHP_FUNCTION(pam_chpass) {
spprintf(&error_msg, 0, "%s (in %s)", (char *) pam_strerror(pamh, result), "pam_authenticate");
zval_dtor(status);
ZVAL_STRING(status, error_msg);
efree(error_msg);
}
pam_end(pamh, PAM_SUCCESS);
RETURN_FALSE;
Expand All @@ -346,6 +351,7 @@ PHP_FUNCTION(pam_chpass) {
spprintf(&error_msg, 0, "%s (in %s)", (char *) pam_strerror(pamh, result), "pam_chauthtok");
zval_dtor(status);
ZVAL_STRING(status, error_msg);
efree(error_msg);
}
pam_end(pamh, PAM_SUCCESS);
RETURN_FALSE;
Expand Down

0 comments on commit 0d74441

Please sign in to comment.