Richard Marian Thomaiyar | 14fddef | 2018-07-13 23:55:56 +0530 | [diff] [blame] | 1 | 1) add free if malloc failed for (*mechanisms)->elements |
| 2 | 2) g_inq_cred.c: In function 'gss_inquire_cred': |
| 3 | g_inq_cred.c:161:8: warning: passing argument 3 of 'generic_gss_copy_oid' from incompatible pointer type [enabled by default] |
| 4 | |
| 5 | Upstream-Status: Pending |
| 6 | Signed-off-by: Yao Zhao <yao.zhao@windriver.com> |
| 7 | |
| 8 | --- a/src/g_inq_cred.c |
| 9 | +++ b/src/g_inq_cred.c |
| 10 | @@ -152,13 +152,15 @@ gss_OID_set * mechanisms; |
| 11 | union_cred->count); |
| 12 | if ((*mechanisms)->elements == NULL) { |
| 13 | *minor_status = ENOMEM; |
| 14 | + free(*mechanisms); |
| 15 | + *mechanisms = GSS_C_NO_OID_SET; |
| 16 | return (GSS_S_FAILURE); |
| 17 | } |
| 18 | |
| 19 | for (i=0; i < union_cred->count; i++) { |
| 20 | - status = generic_gss_copy_oid(minor_status, |
| 21 | + status = generic_gss_add_oid_set_member(minor_status, |
| 22 | &union_cred->mechs_array[i], |
| 23 | - &((*mechanisms)->elements[i])); |
| 24 | + mechanisms); |
| 25 | if (status != GSS_S_COMPLETE) |
| 26 | break; |
| 27 | } |