Hello! As documented in [1] asprintf and vasprintf return: --quote-- Return value: Both functions set *ret to be a pointer to a malloc()'d buffer sufficiently large to hold the formatted string. This pointer should be passed to free() to release the allocated storage when it is no longer needed. The integer value returned by these functions is the number of characters that were output to the newly allocated string (excluding the final '\0'). To put it differently, the return value will match that of strlen(*ret). Upon failure, the returned value will be -1, and *ret will be set to NULL. Note: Upon failure, other implementations may forget to set *ret and leave it in an undefined state. Some other implementations may always set *ret upon failure but forget to assign -1 for the return value in some edge cases. --/quote-- Based on the note above, the attached patch robustifies vasprintf return value checks in jit/jit-recording.c. Actually, the same checks are already implemented in function oprint, around line 1655 in gengtype.c. 2015-02-25 Uros Bizjak * jit-recording.c (dump::write): Also check vasprintf return value. (recording::context::add_error_va): Ditto. (recording::string::from_printf): Ditto. The patch was bootstrapped and regression tested on x86_64-linux-gnu. OK for mainline? [1] http://asprintf.insanecoding.org/ Uros.