diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## [0.4.1]
+### Changed
+- Fix Point Query bug, should no longer give memory issues
+
 ## [0.4.0]
 ### Added
 - You now have access to colliding shapes in a `Collision`
diff --git a/apecs-physics.cabal b/apecs-physics.cabal
--- a/apecs-physics.cabal
+++ b/apecs-physics.cabal
@@ -1,5 +1,5 @@
 name:                apecs-physics
-version:             0.4.0
+version:             0.4.1
 synopsis:            2D physics for apecs
 description:         2D physics for apecs. Uses Chipmunk physics library under the hood.
 homepage:            https://github.com/jonascarpay/apecs#readme
diff --git a/src/Apecs/Physics/Query.hs b/src/Apecs/Physics/Query.hs
--- a/src/Apecs/Physics/Query.hs
+++ b/src/Apecs/Physics/Query.hs
@@ -37,25 +37,22 @@
 pointQuery :: Has w IO Physics => WVec -> Double -> CollisionFilter -> System w (Maybe PointQueryResult)
 pointQuery (fmap realToFrac -> V2 px py) (realToFrac -> maxDistance) (CollisionFilter gr (Bitmask cs) (Bitmask mk)) = do
   Space _ _ _ _ spcPtr :: Space Physics <- getStore
-  liftIO$ do
-    pq <- malloc
+  liftIO $ alloca $ \pq -> do
     withForeignPtr spcPtr $ \space -> [C.block| void {
-      cpPointQueryInfo *pq = $(cpPointQueryInfo *pq);
       cpSpacePointQueryNearest
         ( $(cpSpace *space)
         , cpv($(double px), $(double py))
         , $(double maxDistance)
         , cpShapeFilterNew($(unsigned int gr), $(unsigned int cs), $(unsigned int mk))
-        , pq);
+        , $(cpPointQueryInfo *pq));
       }|]
     res <- peek pq
-    free pq
     if unEntity (pqShape res) == -1
        then return Nothing
        else return (Just res)
 
 instance Storable PointQueryResult where
-  sizeOf ~_ = 40 -- sizeOf (undefined :: Ptr Shape) + 2*sizeOf (undefined :: CDouble) + sizeOf (undefined :: V2 CDouble)
+  sizeOf ~_ = 48 -- sizeOf (undefined :: Ptr Shape) + sizeOf (undefined :: CDouble) + 2*sizeOf (undefined :: V2 CDouble)
   alignment ~_ = 8
   peek ptr = do
     sPtr :: Ptr Shape <- peekByteOff ptr 0
@@ -68,6 +65,6 @@
             } }|]
     p :: V2 CDouble <- peekByteOff ptr 8
     d :: CDouble <- peekByteOff ptr 24
-    g :: CDouble <- peekByteOff ptr 32
-    return $ PointQueryResult (Entity . fromIntegral $ s) (realToFrac <$> p) (realToFrac d) (realToFrac g)
+    g :: V2 CDouble <- peekByteOff ptr 32
+    return $ PointQueryResult (Entity . fromIntegral $ s) (realToFrac <$> p) (realToFrac d) (realToFrac <$> g)
   poke = undefined
diff --git a/src/Apecs/Physics/Types.hs b/src/Apecs/Physics/Types.hs
--- a/src/Apecs/Physics/Types.hs
+++ b/src/Apecs/Physics/Types.hs
@@ -294,8 +294,8 @@
   -- ^ The closest point on the shape's surface (in world space)
   , pqDistance :: Double
   -- ^ The distance to the queried point
-  , pqGradient :: Double
+  , pqGradient :: Vec
   -- ^ The gradient of the distance function.
-  -- This is equal to 'pqPoint'/'pqDistance' but accurate for even
-  -- very small distances. 
+  -- This should be similar to 'pqPoint'/'pqDistance' but accurate even for
+  -- very small distances.
   } deriving (Eq, Show)
