summaryrefslogtreecommitdiff
path: root/libodbcpp/ustring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libodbcpp/ustring.cpp')
-rw-r--r--libodbcpp/ustring.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libodbcpp/ustring.cpp b/libodbcpp/ustring.cpp
index 07a1f44..dd8ee3b 100644
--- a/libodbcpp/ustring.cpp
+++ b/libodbcpp/ustring.cpp
@@ -1,4 +1,5 @@
#include <stdarg.h>
+#include <stdio.h>
#include "ustring.h"
ODBC::String::String()
@@ -32,7 +33,9 @@ ODBC::String::Format(const char * fmt, ...)
char * buf;
va_list va;
va_start(va, fmt);
- vasprintf(&buf, fmt, va);
+ if (vasprintf(&buf, fmt, va)) {
+ buf = NULL;
+ }
va_end(va);
return buf;
}