netpgp : fixed ignored malloc error
authorEdouard Tisserant
Tue, 12 May 2015 17:06:44 +0200
changeset 27673d4c99cf054
parent 273 1017daf29ff4
child 277 5c8838004648
netpgp : fixed ignored malloc error
src/pgp_netpgp.c
     1.1 --- a/src/pgp_netpgp.c	Tue May 12 16:38:37 2015 +0200
     1.2 +++ b/src/pgp_netpgp.c	Tue May 12 17:06:44 2015 +0200
     1.3 @@ -404,6 +404,10 @@
     1.4      *keylist = NULL;
     1.5  
     1.6      vresult = malloc(sizeof(pgp_validation_t));
     1.7 +    if (vresult == NULL) {
     1.8 +        result = PEP_OUT_OF_MEMORY;
     1.9 +        goto unlock_netpgp;
    1.10 +    }
    1.11      memset(vresult, 0x0, sizeof(pgp_validation_t));
    1.12  
    1.13      signedmem = pgp_memory_new();