mirror of
https://github.com/sheumann/AFPBridge.git
synced 2024-06-12 03:29:28 +00:00
Call NewHandle/DisposeHandle directly instead of using ORCA/C's malloc/free.
This commit is contained in:
parent
fe2680b65a
commit
444fdbee49
9
dsi.c
9
dsi.c
|
@ -1,7 +1,7 @@
|
||||||
#pragma noroot
|
#pragma noroot
|
||||||
|
|
||||||
#include <AppleTalk.h>
|
#include <AppleTalk.h>
|
||||||
#include <stdlib.h>
|
#include <memory.h>
|
||||||
#include <orca.h>
|
#include <orca.h>
|
||||||
#include <tcpip.h>
|
#include <tcpip.h>
|
||||||
#include "dsiproto.h"
|
#include "dsiproto.h"
|
||||||
|
@ -99,8 +99,9 @@ top:
|
||||||
goto top;
|
goto top;
|
||||||
} else {
|
} else {
|
||||||
// handle data too long
|
// handle data too long
|
||||||
sess->junkBuf = malloc(dataLength);
|
sess->junkBuf = *NewHandle(dataLength,
|
||||||
if (sess->junkBuf == NULL) {
|
userid(), attrFixed, 0);
|
||||||
|
if (toolerror() || sess->junkBuf == NULL) {
|
||||||
FlagFatalError(sess, atMemoryErr);
|
FlagFatalError(sess, atMemoryErr);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
@ -135,7 +136,7 @@ top:
|
||||||
&& sess->reply.command == sess->request.command)
|
&& sess->reply.command == sess->request.command)
|
||||||
{
|
{
|
||||||
if (sess->junkBuf != NULL) {
|
if (sess->junkBuf != NULL) {
|
||||||
free(sess->junkBuf);
|
DisposeHandle(FindHandle(sess->junkBuf));
|
||||||
sess->junkBuf = NULL;
|
sess->junkBuf = NULL;
|
||||||
if (sess->reply.command == DSIOpenSession) {
|
if (sess->reply.command == DSIOpenSession) {
|
||||||
// We ignore the DSIOpenSession options for now.
|
// We ignore the DSIOpenSession options for now.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user