Changeset 2308


Ignore:
Timestamp:
Jul 27, 2009, 8:59:06 PM (10 years ago)
Author:
bruno
Message:

Fix a bug in mr_strcat backported from 2.2.10. Should solve our seg faults.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mondo/src/lib/mr_mem.c

    r2304 r2308  
    138138    } else {
    139139        mr_asprintf_int(&fmt2, line, file, "%s%s", *in, fmt);
    140         res = vasprintf(&p, fmt2, args);
     140        mr_free_int((void **)in,line,file);
     141        res = vasprintf(in, fmt2, args);
     142        if (res == -1) {
     143            mr_msg_int(1,line,file,"Unable to alloc memory in mr_strcat\nExiting...");
     144            mr_exit(-1,"Unable to alloc memory in mr_strcat");
     145        }
    141146        mr_free_int((void **)&fmt2,line,file);
    142         mr_free_int((void **)in,line,file);
    143         in = &p;
    144147    }
    145148    va_end(args);
Note: See TracChangeset for help on using the changeset viewer.