summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaniel <danieruru@gmail.com>2013-01-24 19:58:02 +0900
committerdaniel <danieruru@gmail.com>2013-01-24 19:58:02 +0900
commit757db4df1c92bd16b787283ef0ae3c2dda70df9d (patch)
tree18d3d4ff8c610aee2b8728471ff497a0c4e9834f
parentee1a47c7b3ee397b9ee8e8d13512affb6ead33c0 (diff)
Fix a leak
-rw-r--r--vxi11_server.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/vxi11_server.c b/vxi11_server.c
index 741b3fb..f8aa439 100644
--- a/vxi11_server.c
+++ b/vxi11_server.c
@@ -175,6 +175,13 @@ device_read_1_svc(Device_ReadParms *argp, struct svc_req *rqstp) {
#ifdef DEBUG
printf("device_read_1_svc()\n");
#endif
+
+ if (result != NULL) {
+ free(result.data.data_val);
+ result.data.data_val = NULL;
+ result.data.data_len = 0;
+ }
+
if (!isValidLink(argp->lid))
result.error = ERR_INVALIDLINKINDENTIFIER;
else if (isLocked() && !haveLock(argp->lid) && !waitForLock(argp->flags, argp->lock_timeout))