File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,11 @@ class Connection : public ObjectWrap {
140
140
Connection *self = ObjectWrap::Unwrap<Connection>(args.This ());
141
141
142
142
char * inputStr = MallocCString (args[0 ]);
143
+
144
+ if (!inputStr) {
145
+ THROW (" Unable to allocate memory for a string in EscapeIdentifier." )
146
+ }
147
+
143
148
char * escapedStr = self->EscapeIdentifier (inputStr);
144
149
free (inputStr);
145
150
@@ -161,6 +166,11 @@ class Connection : public ObjectWrap {
161
166
Connection *self = ObjectWrap::Unwrap<Connection>(args.This ());
162
167
163
168
char * inputStr = MallocCString (args[0 ]);
169
+
170
+ if (!inputStr) {
171
+ THROW (" Unable to allocate memory for a string in EscapeIdentifier." )
172
+ }
173
+
164
174
char * escapedStr = self->EscapeLiteral (inputStr);
165
175
free (inputStr);
166
176
@@ -320,7 +330,7 @@ class Connection : public ObjectWrap {
320
330
Connection *self = ObjectWrap::Unwrap<Connection>(args.This ());
321
331
// TODO handle errors in some way
322
332
if (args.Length () < 1 && !Buffer::HasInstance (args[0 ])) {
323
- THROW (" SendCopyFromChunk requires 1 Buffer argument" );
333
+ THROW (" SendCopyFromChunk requires 1 Buffer argument" );
324
334
}
325
335
self->SendCopyFromChunk (args[0 ]->ToObject ());
326
336
return Undefined ();
You can’t perform that action at this time.
0 commit comments