guard out of memory condition sync
authorVolker Birk <vb@pep.foundation>
Sun, 21 Oct 2018 11:54:49 +0200
branchsync
changeset 3077cef37ebda63b
parent 3076 feab4daed302
child 3078 c9dcf8aa1a08
guard out of memory condition
src/message_api.c
     1.1 --- a/src/message_api.c	Sun Oct 21 11:53:09 2018 +0200
     1.2 +++ b/src/message_api.c	Sun Oct 21 11:54:49 2018 +0200
     1.3 @@ -436,6 +436,9 @@
     1.4      const char base_36_symbols[37] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
     1.5  
     1.6      char* retbuf = calloc(bufsize, 1); 
     1.7 +    assert(retbuf);
     1.8 +    if (!retbuf)
     1.9 +        return NULL;
    1.10  
    1.11      int i = bufsize - 1; // (end index)
    1.12