Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ef7191ecf | ||
|
|
817805f598 | ||
|
|
cfcfbd4360 | ||
|
|
69c0d2a4e1 | ||
|
|
690024f64a | ||
|
|
d8621d034e | ||
|
|
946c4b64ba | ||
|
|
4fee3e0db2 | ||
|
|
23c4b7a54c |
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*.yar linguist-vendored
|
||||||
10
clamav.go
10
clamav.go
@@ -176,8 +176,12 @@ func (c *Clamav) EngineGetNum(field EngineField) (uint64, error) {
|
|||||||
|
|
||||||
// Free the memory allocated to clamav instance, Free should be called
|
// Free the memory allocated to clamav instance, Free should be called
|
||||||
// when the engine is no longer in use.
|
// when the engine is no longer in use.
|
||||||
func (c *Clamav) Free() int {
|
func (c *Clamav) Free() error {
|
||||||
return int(C.cl_engine_free((*C.struct_cl_engine)(c.engine)))
|
ret := ErrorCode(C.cl_engine_free((*C.struct_cl_engine)(c.engine)))
|
||||||
|
if ret == CL_SUCCESS {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return Strerr(ret)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ScanMapCB scans custom data
|
// ScanMapCB scans custom data
|
||||||
@@ -198,7 +202,7 @@ func (c *Clamav) ScanMapCB(fmap *Fmap, fileName string, context interface{}) (ui
|
|||||||
defer CloseMemory(fmap)
|
defer CloseMemory(fmap)
|
||||||
// clean
|
// clean
|
||||||
if ret == CL_SUCCESS {
|
if ret == CL_SUCCESS {
|
||||||
return 0, "", nil
|
return uint(scanned), "", nil
|
||||||
}
|
}
|
||||||
// virus
|
// virus
|
||||||
if ret == CL_VIRUS {
|
if ret == CL_VIRUS {
|
||||||
|
|||||||
Reference in New Issue
Block a user