File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 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 {
140140 Connection *self = ObjectWrap::Unwrap<Connection>(args.This ());
141141
142142 char * inputStr = MallocCString (args[0 ]);
143+
144+ if (!inputStr) {
145+ THROW (" Unable to allocate memory for a string in EscapeIdentifier." )
146+ }
147+
143148 char * escapedStr = self->EscapeIdentifier (inputStr);
144149 free (inputStr);
145150
@@ -161,6 +166,11 @@ class Connection : public ObjectWrap {
161166 Connection *self = ObjectWrap::Unwrap<Connection>(args.This ());
162167
163168 char * inputStr = MallocCString (args[0 ]);
169+
170+ if (!inputStr) {
171+ THROW (" Unable to allocate memory for a string in EscapeIdentifier." )
172+ }
173+
164174 char * escapedStr = self->EscapeLiteral (inputStr);
165175 free (inputStr);
166176
@@ -320,7 +330,7 @@ class Connection : public ObjectWrap {
320330 Connection *self = ObjectWrap::Unwrap<Connection>(args.This ());
321331 // TODO handle errors in some way
322332 if (args.Length () < 1 && !Buffer::HasInstance (args[0 ])) {
323- THROW (" SendCopyFromChunk requires 1 Buffer argument" );
333+ THROW (" SendCopyFromChunk requires 1 Buffer argument" );
324334 }
325335 self->SendCopyFromChunk (args[0 ]->ToObject ());
326336 return Undefined ();
You can’t perform that action at this time.
0 commit comments