Ticket #4142: fix-memory-error.diff

File fix-memory-error.diff, 507 bytes (added by spiv, 4 years ago)

fix for memory error

  • twisted/protocols/_c_urlarg.c

    === modified file 'twisted/protocols/_c_urlarg.c'
     
    4747    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|c:unquote", kwlist, &s, &length, &escchar)) { 
    4848        return NULL; 
    4949    } 
     50    if (length == 0) { 
     51        return PyString_FromStringAndSize("", 0); 
     52    } 
    5053    /* output = cStringIO() */ 
    5154    output = PycStringIO->NewOutput(length); 
    5255    if (output == NULL) {