From 48db194b96a53f442c3993b85bec4f5282350e07 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Fri, 25 Jun 2010 16:59:14 +0200 Subject: [PATCH] isl_stream_new_str: check result of allocation --- isl_stream.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/isl_stream.c b/isl_stream.c index 3629610..c917fb8 100644 --- a/isl_stream.c +++ b/isl_stream.c @@ -140,9 +140,11 @@ struct isl_stream* isl_stream_new_file(struct isl_ctx *ctx, FILE *file) struct isl_stream* isl_stream_new_str(struct isl_ctx *ctx, const char *str) { - struct isl_stream *s = isl_stream_new(ctx); - s->str = str; - return s; + struct isl_stream *s = isl_stream_new(ctx); + if (!s) + return NULL; + s->str = str; + return s; } static int isl_stream_getc(struct isl_stream *s) -- 2.7.4